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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make a report with weekend date?

Status
Not open for further replies.

bloomlight

IS-IT--Management
Jun 12, 2006
149
US
I need to make a report which will only capture data of the weekends for month of Oct & Nov. How could I do that? Thanks.
 
I can think of three ways to do this.

1. Use a Command instead of tables. In the where clause, use the specific syntax for your database to get the day of week of the date field you're looking at. For MS SQL Server, it will look something like this:

table.datefield between '1/10/2009' and '11/30/2009'
and DatePart(dw, table.datefield) in (1, 7)

2. In the Select Expert, select your date field, then "between", then the start and end dates. Then click on the Formula button and add something like the following:

and (DatePart('w', {table.datefield}) = 1 or
DatePart('w', {table.datefield}) = 7)

3. In the Select Expert, select your date field, then "is one of", then enter the specific weekend dates you're looking for.

Option 3 is not as flexible as the other two because you're hard coding the dates in. For Options 1 and 2 you could create parameters to hold the start date and end date so the report could be run for any timeframe.

-Dell


A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top