Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
karan_kn
Creator II
Creator II

setup dynamic date in where clause current month

Please help me to setup date dynamic instead of hardcoding in where clause current month, so that it will update with current month in incremental load

T1:

LOAD CustID,

     Sales_Date

FROM

Inventry.xlsx (ooxml, embedded labels, table is Sheet2)

Where Sales_Date>='12/01/2018' and Sales_Date<='12/31/2018';

Store QVD

1 Solution

Accepted Solutions
sunny_talwar

May be this

Where Sales_Date>=MonthStart(Today()) and Sales_Date<=MonthEnd(Today());

View solution in original post

4 Replies
sunny_talwar

May be this

Where Sales_Date>=MonthStart(Today()) and Sales_Date<=MonthEnd(Today());

karan_kn
Creator II
Creator II
Author

Thanks Sunny stalwar1 , Can you help me to setup where clause for this as well:

Last two years :

Where Sales_Date>='01/01/2015' and Sales_Date<='12/31/2017'

sunny_talwar

May be this

Where Sales_Date>=YearStart(Today(), -3) and Sales_Date<YearStart(Today());

Note that instead of doing <= 12/31/2017, I did < 01/01/2018

karan_kn
Creator II
Creator II
Author

Thanks Sunny