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!

Assinging a data type to a query field

Status
Not open for further replies.

rplant

MIS
Aug 20, 2002
10
US
Hi

I have a query which pulls two fields from a table. The fields are:

Month
Year

In the table both of these fields are of data type "Number"

In the query I put them together by:
Date: [tblArchive].[Month] & " " & [tblArchive].[Year]

What I want to do is make the data type of the new "Date" field to be date/time so that I can use certain date/time functions. Is this possible? TIA

Rob
 
Hi,

SELECT CDate([tblArchive].[Month] & " " & [tblArchive].[Year]) AS [Date]
FROM tblarchive
WHERE (((tblarchive.Month) Is Not Null) AND ((tblarchive.Year) Is Not Null));

Have a good one!
BK
 
That worked flawlessly. Thank you so much!!! You are a life saver! Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top