Importing Date/Time fields

  • Thread starter Thread starter Nuttingd
  • Start date Start date
N

Nuttingd

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?
 
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
 
No question in my mind: they should be a single field. Makes querying much
easier.
 
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
 
Back
Top