469,323 Members | 1,641 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Strip time from date?

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


Jul 19 '05 #1
2 3486
If it's just for display then use FormatDateTime

"jason" <ja***@catamaranco.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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

Jul 19 '05 #2
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
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.