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!

Extract the month value from a date string

Status
Not open for further replies.

ecugrad

MIS
Apr 17, 2001
191
US
I have a Processdate field in a query:ex 4/12/2007. To build a relationship with another table I need to extract just the month value from the above Processdate string, that is I want to just return the "4".

Thanks for any help.

Mike
 
If it is a date datatype, have a look at the MONTH and DATEPART functions in Access' help.

so it'd just be
Code:
MONTH(ProcessDate)

If its' actually stored as a string, then you will need to look at LEFT and INSTR functions to get what you need.

and example of this would be
Code:
left(ProcessDate, instr(ProcessDate, '/') -1)

Which data type is it?

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top