Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a requirement that i need to generate a flag for a date field
-- when the month end date falls on week end --> Flag=1
-- when the month end falls on other than week end --> Flag=0
Ex: If Jan 31 falls on Sunday (Last day of the week) -- Flag=1 (Let's consider week starts from Monday)
If Jan 31 falls on other than Sunday ( not last day of the week) -- Flag=0
How to achieve this ?
Thanks
if(num(weekday(Date))=5 or num(weekday(Date))=6,1,0) as Flag
if(num(weekday(Monthend(Date)))=5 or num(weekday(Monthend(Date)))=6,1,0) as Flag
thx - I forgot the monthend
If you will consider the weekend :
if((DayEnd(Date)=MonthEnd(Date) and (weekday(Date)>4 ), 1, 0)
If you will consider only sunday:
if((DayEnd(Date)=MonthEnd(Date) and (weekday(Date)>5 ), 1, 0)