Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to implement a if condition where I need to check whether today is the 4th day of the month. Based on that the script would load data from a resident table.
If the script is run on or before 4th day of the month, then load data from start of previous month till current day.
If the script is run after 4th day of the month, then load data from start of current month till current day.
I'm trying it like below. Really appreciate any pointers.
IF( inmonthstodate(2, Today(), 'LOGIC_TO_CHECK_4TH_DAY_OF_CURRENT_MONTH', 0)) THEN
out:
load LDATE AS ODATE resident TABLE1 where LDATE 'LOGIC_TO_PROVIDE_DATE RANGE'
ELSE
out:
load LDATE AS ODATE resident TABLE1 where LDATE >=MonthStart(Today()) and LDATE<=Today();
ENDIF;
store out into out.csv (TXT);
Let vTodayDayNum = Day(Today());
IF vTodayDayNum <= 4 THEN
Logic1
ELSE
Logic2
End IF
Let vTodayDayNum = Day(Today());
IF vTodayDayNum <= 4 THEN
Logic1
ELSE
Logic2
End IF
Thank you so much. This helped me think in the right direction.