1 Reply Latest reply on Mar 8, 2013 3:57 AM by user503635

    Date parsing statement from T-SQL to PL/SQL

      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