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!

Split query result into 5 fields on a report.

Status
Not open for further replies.

1ooo1

Technical User
Jan 20, 2003
50
AU
Hi,
I have a query that gives me the weekday number for all the weekdays between 2 and 6 (Mon to Fri). So these will all be under the field Expr1...as follows
Expr1 Date
2.......6 Jan 2003
3.......7 Jan 2003
4.......8 Jan 2003
5.......9 Jan 2003
6......10 Jan 2003
2......13 Jan 2003
3......14 Jan 2003
4......15 Jan 2003 ..etc, etc

How would I get all the 2's in Expr1 into their own field in a report and all the 3's in their own field, etc..

2....6 Jan 2003 . . 3....7 Jan 2003 .. 4....8 Jan 2003
2...13 Jan 2003 . . 3...14 Jan 2003 .. 4..15 Jan 2003
etc etc

Ken
 
Please post your existing SQL so that we may work with what you already have.

Bob Scriver
 
Hi Bob,
Here is my SQL

SELECT Table3.TheDate, Table3.Message, DatePart("w",[TheDate]) AS Expr1
FROM Table3
WHERE (((DatePart("w",[TheDate])) Between 2 And 6));

I have a table (Table3) with a Field called TheDate (all dates of the year) a field called Message.


Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top