Importing Date/Time fields

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?
 
J

Jeff Boyce

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
 
D

Douglas J. Steele

No question in my mind: they should be a single field. Makes querying much
easier.
 
D

DavidAtCaspian

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
 

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