Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create parameter to pull data from database column?

Status
Not open for further replies.

RhondaCarroll

Programmer
Sep 15, 2003
2
US
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!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top