Format of Date/Time

G

Guest

I have a Table which consist of two fields(Date/Time format): [Rock Dte] and
[Earth Dte]
example of data:
8/1/2005 1:00:00 PM 9/1/2005 2:00:00 AM
8/2/2005 1:23:00 PM 8/23/2005 5:00:00 PM
8/5/2005 9:23:00 PM 8/30/2005 8:00:00 AM

How can I separate the dates and times into four new fields?
Example
Date1 Time1 Date2 Time2
08/1/2005 01:00 09/1/2005 02:00
08/2/2005 01:23 08/23/2005 17:00
I tried just changing the format to the fields, but when I look at the date
it's still formatted as "08/01/2005 1:23:00 PM" even if the format is short
date "##/##/####" it still shows "08/01/2005 1:23:00 PM"
Thanks
 
F

fredg

I have a Table which consist of two fields(Date/Time format): [Rock Dte] and
[Earth Dte]
example of data:
8/1/2005 1:00:00 PM 9/1/2005 2:00:00 AM
8/2/2005 1:23:00 PM 8/23/2005 5:00:00 PM
8/5/2005 9:23:00 PM 8/30/2005 8:00:00 AM

How can I separate the dates and times into four new fields?
Example
Date1 Time1 Date2 Time2
08/1/2005 01:00 09/1/2005 02:00
08/2/2005 01:23 08/23/2005 17:00
I tried just changing the format to the fields, but when I look at the date
it's still formatted as "08/01/2005 1:23:00 PM" even if the format is short
date "##/##/####" it still shows "08/01/2005 1:23:00 PM"
Thanks

You should be able to format the date or time using
mm/dd/yyyy
in the format property of the DateField for the Date portion
and
hh:nn:ss am/pm
as the format property of the DateField for the Time portion.

If you wish to actually split the data into different fields, you can
use:

DatePart = DateValue([DateField])
TimePart = TimeValue([DateField])

or

DatePart = Int([DateField])
TimePart = [DateField]-Int([DateField])

You still may need to set the format property of the field.
 

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

Top