RhondaCarroll
Programmer
Hi,
I am creating a report for that will allow me to query the services used for a customer. The data is stored within several tags, please see the attachment. I have the following query but I don't know how to create the parameter properly so if I type Service B, it will return every line with Service B. Please note that on each line, a service may be repeated several times. This is an example of 3 rows from the services column in the database.
<values><value>Service M</value><value>Service M</value><value>Service A</value></values>
<values><value>Service C</value><value>Service A</value></values>
<values><value>Other</value><value>Service A</value></values>
<values><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service A</valu
<values>
<value>Service mini-M</value><value>Service mini-M</value><value>Service A</value></values>
Here is my query right now:
SELECT id, status, userNameStep_sales_entry, savedStep_sales_entry, userNameStep_backoffice_calc,
savedStep_backoffice_calc, accountName, accountNr, currency, area,
(REPLACE(REPLACE(REPLACE(REPLACE(CAST(serviceType AS varchar(1000)), 'null', ' '), '<values><value>', ' '), '</value><value>', ','), '</value></values>', ' ')) AS Services,
(REPLACE(REPLACE(REPLACE(REPLACE(CAST(serviceCreditvat AS varchar(1000)), 'null', ' '), '<values><value>', ' '), '</value><value>', ','), '</value></values>', ' ')) AS serviceCreditVat,
totalCredit, totalCreditvat, grandTotal, sosarNr, reason, errorSource, intReason, created_on
FROM CREDITNOTe
ORDER BY id
Please help!!!!!
I am creating a report for that will allow me to query the services used for a customer. The data is stored within several tags, please see the attachment. I have the following query but I don't know how to create the parameter properly so if I type Service B, it will return every line with Service B. Please note that on each line, a service may be repeated several times. This is an example of 3 rows from the services column in the database.
<values><value>Service M</value><value>Service M</value><value>Service A</value></values>
<values><value>Service C</value><value>Service A</value></values>
<values><value>Other</value><value>Service A</value></values>
<values><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service C</value><value>Service A</valu
<values>
<value>Service mini-M</value><value>Service mini-M</value><value>Service A</value></values>
Here is my query right now:
SELECT id, status, userNameStep_sales_entry, savedStep_sales_entry, userNameStep_backoffice_calc,
savedStep_backoffice_calc, accountName, accountNr, currency, area,
(REPLACE(REPLACE(REPLACE(REPLACE(CAST(serviceType AS varchar(1000)), 'null', ' '), '<values><value>', ' '), '</value><value>', ','), '</value></values>', ' ')) AS Services,
(REPLACE(REPLACE(REPLACE(REPLACE(CAST(serviceCreditvat AS varchar(1000)), 'null', ' '), '<values><value>', ' '), '</value><value>', ','), '</value></values>', ' ')) AS serviceCreditVat,
totalCredit, totalCreditvat, grandTotal, sosarNr, reason, errorSource, intReason, created_on
FROM CREDITNOTe
ORDER BY id
Please help!!!!!