|
-
Newbie - converting Access SQL to Oracle
I'm having a problem converting a query from Access SQL to Oracle. My problem is with the Access Iif statement. I thought it would be as simple as using the 'DECODE' function, but am having problems. Here's the portion of the Access SQL I am having trouble converting:
SELECT PERSONID,
Sum(IIf([INVOICEDATE]>=#1/1/2002#,IIf([INVOICEDATE]<#2/1/2002#,[SHIPPING],0),0)) AS Jan02U,
Sum(IIf([INVOICEDATE]>=#2/1/2002#,IIf([INVOICEDATE]<#3/1/2002#,[SHIPPING],0),0)) AS Feb02U,....Continues on until 4/1/2009
From NETSALESEXTRACT
Group by PERSONID
Basicaly what I am trying to do is return the [SHIPPING] field if the invoice date is between Jan 1st and Feb 1st. If not, the query returns 0 for that field.
Any help on how to re-write this for Oracle would be greatly appreciated.
Thank you all in advance!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|