i have a table with columns serial_no, item_no, cost,receipt date. i need to write an qeury that looks like the following:
select item_no, cost, datediff(d,receiptdate,getdate())<=30 as "30",datediff(d,receiptdate,getdate())between 31 and 60 as "60",
datediff(d,receiptdate,getdate())between 61 and 90 as "90"
i cannot do this as mentioned above, i get Incorrect syntax near '<'.
how can i accomplish the above on. it is basically that i want to sum the items and cost that was received less and 30 days ago, than column "60" = receipt date is between 30 and 60 days old, and column 90 means receipt date of items that
are bewteen 61 and 90 days.
I will really appreciate any help.....
View Complete Post