Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I am using the below code . I am expecting only complete month data to be picked up .When I am adding the (and end_date=MonthEnd(end_date,0)) clause its not not picking up any rows but I would expect to pick up 1 record.
Can you please help me with the correct syntax
XX :
load * inline [start_date,end_date
01/01/2000,31/01/2020
05/01/2000,31/01/2020
];
NoConcatenate
XX1 :
load * resident XX
where start_date=monthstart(start_date,0)
and end_date=MonthEnd(end_date,0);
drop table XX;
exit Script;
Thanks you so much for the clarification and now its working as per expectation.
As per the MonthEnd documentation:
This function returns a value corresponding to a timestamp of the last millisecond of the last day of the month containing date.
monthend('19/02/2012') Returns 29/02/2012 23:59:59.
You'll need to floor that or use DayStart() to get rid of the timestamp, presumably, in your use case.
Thanks you so much for the clarification and now its working as per expectation.