Is it better to have Date/Time in seperate fields or one field?
I have a current database with Date and Time in seperate fields, and am
rebuilding the layout for better flexibility. In my new database if I make
date and time one field is there a way to import the data and combine the
seperate fields from the original to one field in the new database?
Jeff Boyce - 08 May 2008 19:14 GMT
My preference is to use a single Date/Time field to store "point-in-time"
data, then use the built-in functions to get whatever pieces back out I
need.
Try taking a look at the CDate() function (Access HELP) ... it may be a way
you could convert a concatenated [datefield] & [timefield] into an actual
Date/Time value in a query.
Regards
Jeff Boyce
Microsoft Office/Access MVP
> Is it better to have Date/Time in seperate fields or one field?
>
> I have a current database with Date and Time in seperate fields, and am
> rebuilding the layout for better flexibility. In my new database if I make
> date and time one field is there a way to import the data and combine the
> seperate fields from the original to one field in the new database?
Douglas J. Steele - 08 May 2008 22:09 GMT
No question in my mind: they should be a single field. Makes querying much
easier.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Is it better to have Date/Time in seperate fields or one field?
>
> I have a current database with Date and Time in seperate fields, and am
> rebuilding the layout for better flexibility. In my new database if I make
> date and time one field is there a way to import the data and combine the
> seperate fields from the original to one field in the new database?
DavidAtCaspian - 10 May 2008 12:34 GMT
Well to actually answer your question.....
Assuming your exsting date and time fields are both defined as date/time
types, you can combine them VERY simply.
Just make an update query which adds the two fields together.
So if your current date is field [dt], time is field [tm], then call your
combined field [dttm], and for your update query [dttm] = [dt] + [tm].
Hope this helps
> Is it better to have Date/Time in seperate fields or one field?
>
> I have a current database with Date and Time in seperate fields, and am
> rebuilding the layout for better flexibility. In my new database if I make
> date and time one field is there a way to import the data and combine the
> seperate fields from the original to one field in the new database?