I have Startdate & Enddate coming from form(Query String) also has holiday master(view). Then in an agent how to calculate that in given range how many Saturday & Sunday are there.I have to calculate total no. of days starting from startdate to enddate excluding saturday,sunday & Holiday.
any inputs are valuable
Subject: How 2 Calculate No. of days excluding week offs from given date range
Use the @Weekday function in formula or Weekday in script. The parameter is the date, the return value is 1 to 7. As I know the 1 is Sunday and 7 is Saturday.
Subject: RE: How 2 Calculate No. of days excluding week offs from given date range
Or use @BusinessDays
That will exclude Saturdays and Sundays and it also has a parameter to add other dates to exclude
Mike
Subject: RE: How 2 Calculate No. of days excluding week offs from given date range
Hi Mike,Thanks for showing interest.
I m writing an agent where m getting Start & End dates by query string. Then what should be my code using ‘@BusinessDays’?
m storing those date values in 2 variables
say varstartdate & varenddate.
Subject: RE: How 2 Calculate No. of days excluding week offs from given date range
Hi,
The sintax is : @BusinessDays( startDates ; endDates ; daysToExclude ; datesToExclude ).
Example: @BusinessDays([01/01/2001]; [12/31/2001]; 1 : 7;[01/01/2001]:[11/23/2001] : [12/25/2001]).
It meanns that if you use string for start and end date than you have to convert to date format.
Attila
Subject: RE: How 2 Calculate No. of days excluding week offs from given date range
Hi,
The sintax is : @BusinessDays( startDates ; endDates ; daysToExclude ; datesToExclude ).
Example: @BusinessDays([01/01/2001]; [12/31/2001]; 1 : 7;[01/01/2001]:[11/23/2001] : [12/25/2001]).
It meanns that if you use string for start and end date than you have to convert to date format.
Attila
Attila