Larry Linson wrote:
<co*********@gmail.comwrote
Hi: Data in my table is in that format. How
to i separate date with time.
>
11/9/2006 10:10:46 AM
There is no "date only" field, nor "time only" field. There is only a
date/time field. But it is easy to extract just the date or just the time
from a Date/Time field:
datSomeDate = Date(Me.txtMyDateAndTime)
timSomeTime = Time(Me.txtMyDateAndTime)
A Date/Time Field set only to the Date should show a time of Midnight.
A Date/Time Field set only to Time will show that time with a date of Dec.
30, 1899.
Larry Linson
Microsoft Access MVP
I was unaware that VBA Date() and Time() took arguments. In fact I'm
having trouble getting this to work under Access 2003. Are you sure
you haven't superseded the VBA functions with your own?
I've always used format() for this, e.g.
format("11/9/2006 10:10:46 AM","m/d/yyyy") = "11/9/2006"
format("11/9/2006 10:10:46 AM","h:nn AM/PM") ="10:10 AM"
format("11/9/2006 10:10:46 AM","h:nn:ss AM/PM") ="10:10:46 AM"
Bruce