Forum Discussion

Satish_Kumar's avatar
Satish_Kumar
Icon for Helper V rankHelper V
8 years ago
Solved

how to calculate date difference between two date

Hi,

 

I am trying to calculate date difference two dates which in two different column but when i am applying DATEDIFF its gives me error

please suggest me where i am doing wrong.

 

Regards,

Satish

  • Satish_Kumar's avatar
    Satish_Kumar
    8 years ago

    this is working for now...

     

    Day Difference = DATEDIFF(('GRN Pst TO GRN Entry Date'[GRN_POSTING_DATE].[Date]),('GRN Pst TO GRN Entry Date'[GRN_ENTRY_DATE].[Date]),DAY)

2 Replies

  • Hi Satish_Kumar,

     

    Please remove the minus(-) between the date and replace it by comma(,).

     

    You can see how datediff works: 

    DATEDIFF(<start_date>, <end_date>, <interval>)  

     

    Hope it helps...

     

    Ninter

     

    • Satish_Kumar's avatar
      Satish_Kumar
      Icon for Helper V rankHelper V

      this is working for now...

       

      Day Difference = DATEDIFF(('GRN Pst TO GRN Entry Date'[GRN_POSTING_DATE].[Date]),('GRN Pst TO GRN Entry Date'[GRN_ENTRY_DATE].[Date]),DAY)