Hello,
I posted this about an hour ago but I haven't see it come up on the board so I am reposting in case i made a mistake. I apologize in advance if I am reposting. Here goes
I have a table that contains 3 fields. Type (a type of labor performed), amount (dollar value), and invoice number. On one invoice number there can be different labor performed. For example invoice x could have 4 entries
type amount invoice
----- ----- -------
k 10 1
u 20 1
G 30 1
t 40 1
I want to do a query to return different types into different colums. Would the code below work in SQL 6.5? If not, how can I add CASE logic or IF... ELSE logic into a sql 6.5 query. Thanks a whole lot. I would try this out but i am at home and cant access the server.
case
when ((type="k" or (type="u") THEN
approved_amount as KIT
when ((type="g" or (type="t") THEN
approved_amount as glass_approved_amount
END
I posted this about an hour ago but I haven't see it come up on the board so I am reposting in case i made a mistake. I apologize in advance if I am reposting. Here goes
I have a table that contains 3 fields. Type (a type of labor performed), amount (dollar value), and invoice number. On one invoice number there can be different labor performed. For example invoice x could have 4 entries
type amount invoice
----- ----- -------
k 10 1
u 20 1
G 30 1
t 40 1
I want to do a query to return different types into different colums. Would the code below work in SQL 6.5? If not, how can I add CASE logic or IF... ELSE logic into a sql 6.5 query. Thanks a whole lot. I would try this out but i am at home and cant access the server.
case
when ((type="k" or (type="u") THEN
approved_amount as KIT
when ((type="g" or (type="t") THEN
approved_amount as glass_approved_amount
END