Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to exclude weekends while fetching records 1

Status
Not open for further replies.

varadha72

Programmer
Oct 14, 2010
82
US
Hi,

I have 2 parameters- Start and end date, which I used in the record selection to filter the record selection.
I have a date field which displays all nonworking days (NonworkingDay_Date).

Requirement: I need to display the Holidays only and not display weekends and display the dates as comma separated field.

In Header- @Init
WHILEPRINTINGRECORDS;
STRINGVAR Holidays:="";
STRINGVAR finaloutput;

IN Details- @Holidays
WHILEPRINTINGRECORDS;
STRINGVAR Holidays;
Holidays:=Holidays+","+ TOTEXT(CDATE({NonWorkingDay_Date}),"MM/dd/yy");
Holidays;

In Footer-@Final Output
WHILEPRINTINGRECORDS;
STRINGVAR Holidays;
Holidays;

The above formula displays all holidays including weekends. Can someone share how I could exclude the weekends please.
 
@Holidays

[tt]WHILEPRINTINGRECORDS;
STRINGVAR Holidays;
if not(DayOfWeek ({NonWorkingDay_Date}) in [7,1]) then
Holidays:=Holidays+","+ TOTEXT(CDATE({NonWorkingDay_Date}),"MM/dd/yy");
Holidays;[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top