Strip time from date?

J

jason

Could someone help me work out out a way to either convert a smalldatetime
value from my database(access) to a normal date with out the trailing time.

Is it simple matter of using FormatDate or does one need to do string
maniupulation?

Current
9/13/2003 11:36:00 AM

What I want:
9/13/2003

Thanks
Jason
 
D

dlbjr

If all you want to store in the database is the date then set this in the
field properties in access

For presentation purposes use

dtmDate = "9/13/2003 11:36:00 AM" ' rs("date_field")
dtmDate = ConvertDate(dtmDate)

Function ConvertDate(str1)
ConvertDate = "NAD"
If IsDate(str1) Then
ConvertDate= FormatDateTime(str1,2)
End If
End Function


-dlbjr

invariable unerring alien
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,094
Messages
2,570,615
Members
47,231
Latest member
Satyam

Latest Threads

Top