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

Can i show the day in a report by using a date field

Status
Not open for further replies.

Juddy58

Technical User
Jan 21, 2003
176
AU
hello i have a report that has a date field im just wondering if there is a way i can use a function or something to show the particular day by calculating the date field
eg, the date field contains "16/03/2003" i need to show "Sunday" on the report by working it out from the date. 17/03/2003 would be "monday" and so on.
Any help would be appreciated.
Thanks!
 
Hi

THE function WeekDay() will return a day number within the week from a date (eg 1-7), set up an array eg

Dim WDays(7) As String
Dim strDay as String
WDays(1) = "Sunday"
WDays(2) = "Monday"
..etc

strDay = WDays(WeekDate(YourDateField))
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Format([DateField],"dddd")

That should do what you want.

Paul
 
Hi Paul,

of course it will!! well done

talk about not seeing the wood for the trees sometimes!! Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks fellas works perfectly!
Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top