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

Date Format

Status
Not open for further replies.

KalEl33

Programmer
May 20, 2002
17
US
I would like to get the year part of a date from table called tblTempDate. I would then like to add "January" to the front of the year inorder to run a query using the new date (e.g. January 2000). I've tried using the following as the query criteria, but I get a mismatched type error.

= Format("January " & DatePart("yyyy", ([tblTempDate].[TempDate])), "mmmm yyyy")

Any ideas on how to grab the year part of a date, then convert that date into "January year"? (E.g. TempDate = May 2002, the result I'm looking for is January 2002.)

Thanks in advance for your help.

Sincerely,
Kal-El
 
Try this: create your query based on your form. In the first column of the query, type in the 'Field:' row:

NewDate: "January " & DatePart("yyyy", [tblTempDate]![TempDate])

It seems to work, hope it helps,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top