Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team ,
I have a date1 field . i want to create an another field date2 which will be the date1 +3 days but should exclude weekends like saturday and sunday
Hi,
Do you mean the base date(Date1) should not be the Saturday Sunday?
If yes then you can do this
If(not Wildmatch(Weekday(Date1),'Sat','Sun'),Date(Date1 + 3)) as Date2
If you want Date2 to exclude the Saturday and Sunday, try this
If(not Wildmatch(Weekday(Date(Date1+3)),'Sat','Sun'),Date(Date1 + 3)) as Date2
Regards,
Kaushik Solanki
may be like this?
Load
*,
Date1,
IF(weekday(Date1)<>'Sat' or weekday(Date1)<>'Sun', num(Date1)+3) as Date2
from Table;
Hi Bionod,
assuming your date is a date number (integer like 43255) and fieldname is DayNr (check with klistbox and change format to Integer)
load * where Day <> 'Sa' and Day <> 'Su'; //Deselect the Saturdays and Sundays you can do this also with daynumer (of the week)
Weekday(NewDayNr) as Day
load *,
DayNr + 3 as NewDayNr
resident YourTable;
Hi Binod,
You can calculate de weekday, if it is on weekend you can add more days, something like this:
Date+3+IF(WeekDay(Date+3) = 0,1,IF(WeekDay(Date+3) = 6,2,0))
Regards!!
try lastworkdate which doesnot calculate Weekends
lastworkdate(date1,3) as date2
if date1+3 is a Weekend, the next monday will be defined
yes my base date will always be date1