Date & Time Field

D

Diane Walker

I have a field that combines both date and time (MM/DD/YYYY HH:MM:SS AM or
PM). Is there a way to break this field into a date field (MM/DD/YYYYY )
and a time field (HH:MM)? Thanks.
 
T

Tom Ellison

Dear Dianne:

Breaking up a date/time field like this is rarely a good idea. It is better
to leave the way it is stored alone, and then divide its parts whenever you
need to look at the parts separately. Use the DatePart function for this.

Tom Ellison
 
D

Dale Fye

Diane,

If by break this field in two is create a query or just display the Date and
Time values in separate textboxes or query columns, absolutely. Use the
DateValue and TimeValue functions.

If, on the other hand, you want to create two fields in your table with
these separate parts of the data, I agree with Tom and would recommend
against it.

HTH
Dale
 
D

Diane Walker

Thanks very much for your suggestions, Tom.

Tom Ellison said:
Dear Dianne:

Breaking up a date/time field like this is rarely a good idea. It is
better to leave the way it is stored alone, and then divide its parts
whenever you need to look at the parts separately. Use the DatePart
function for this.

Tom Ellison
 
D

Diane Walker

Thanks very much for your suggestions, Dale.

Dale Fye said:
Diane,

If by break this field in two is create a query or just display the Date
and Time values in separate textboxes or query columns, absolutely. Use
the DateValue and TimeValue functions.

If, on the other hand, you want to create two fields in your table with
these separate parts of the data, I agree with Tom and would recommend
against it.

HTH
Dale
 

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

Similar Threads


Top