This discussion is archived
1 Reply Latest reply: Mar 7, 2013 7:57 PM by user503635 RSS

Date parsing statement from T-SQL to PL/SQL

995588 Newbie
Currently Being Moderated
I'm new at this so go easy on me. :/ There's a statement written in TSQL that does something with a date field and I'm wondering if there's a way to do the equivalent in PL/SQL. It's the "DATEADD(d, 1-DATEPART(d,a.PROD_DT),a.PROD_DT)," statement I'm mainly concerned with, but I don't really know what it's doing.

Any ideas?

LEFT OUTER JOIN [Edw].[DIM].[Date] d
     ON ISNULL(a.ACCT_DT,'') = ISNULL(d.[Date],'') AND 1=d.RecordIsCurrent
LEFT OUTER JOIN [Edw].[DIM].[Date] m
     ON ISNULL(DATEADD(d, 1-DATEPART(d,a.PROD_DT),a.PROD_DT),'') = ISNULL(m.[Date],'')

Thanks in advance!

Edited by: 992585 on Mar 7, 2013 6:34 PM


  • Correct Answers - 10 points
  • Helpful Answers - 5 points