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

Expression to cng date to day not working

Status
Not open for further replies.

kentwoodjean

Technical User
Oct 19, 2002
376
US
Have query with daily data formatted as from date (06/22/04) and todate (06/22/04) for each day of the week. Want to create another field using an expression that indicates its a Monday, Tuesday, Wednesday, etc. Currently, I have an expression that reads:
Expr1: Format([ToDate],"dddd") which is what I found on another post on the forum as well as the help files in access. Obviously this is not enought as I get a #error as a result when I run the query.

What is missing here?
 
This should show you how to use the different date functions...

someTable
id (autonumber)
toDate (date/time)

Code:
SELECT id, toDate, (Format(toDate,"dddd") & ', ' & Format(toDate,"mmmm") & ' ' & DatePart("d", toDate) & ', ' & DatePart("yyyy", toDate)) as formattedDate
FROM someTable;

HtH,

Rob

-Focus on the solution to the problem, not the obstacles in the way.-
 
Hi, try this in a query field:

WkDay: WeekdayName(Weekday(Date()))

Hth
 
Hi,

Seem like ToDate may be not a date at all. Are you SURE that ToDate is REALLY a Date? Check your design.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Have you tried this ?
Expr1: Format(CDate([ToDate]),"dddd")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks everyone for your responses. I will try them with my program when I get to work tomorrow and let you know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top