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

Convert Number field to Date field

Status
Not open for further replies.

cjany

IS-IT--Management
Nov 3, 2004
72
US
I have a 4 digit number field (2006) which represents the year. I need to convert to date format so that I can query the current year.

Thanks for any assistance.

 
Use this in your query...

WHERE Year([YourDateField]) = 2006
 
No. I don't want to always have to enter the year. I want the query to always pull whatever the current year is.
 
Where [your 4 digit number field] = Year(Date())

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
HHMM no that's not working. Remember this field is currently a number data type and I want to convert it to a date type.
 
So this 4 digit number field is in your table, and you want to query for records that match the current year? If that's the case PHV's post should do the trick. You wouldn't need to convert the field to a date/time data type.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top