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

Date Format Issue 1

Status
Not open for further replies.

ajhts

Technical User
May 1, 2001
84
US
I have three fields called MONTH, DAY, and YEAR
they are all in number format, example:
MONTH DAY YEAR
1 7 2005

In my query I have created a field called Date of Treatment and combined the three above fields to form my date. The expression is [Month] & [Day] & [Year]
This works great, it combines the numbers as 172005
Now, I need this in the proper date format to show
1/7/2005. This is the part that I am stuck on.

Please help!
Thank you.
AJ
 
You need the numbers as a DateTime. "172005" is not a datetime ... just concatenated numbers. Try
Code:
Format ( DateSerial(2005, 1, 7), "m/d/yyyy" )
 
If you want the value to be a real date then you can use:
dateserial([year],[month],[day])
If you just want a text string then you just expand your previous solution:
[month] & "/" & [day] & "/" & [Year]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top