View Full Version : Combining two separate fields in a table or query into one - Can it be done?


THERESA MARIE LOPEZ
02-21-2002, 06:55 AM
I recently separated a field in a query into two fields. For Example:
Originally the field held date and time
such as: 01/31/02 06:30

I changed this by defining two fields in
query as:
Date: Left([OperationDateTime],8)
Time: Right([OperationDateTime],5)

This made data entry much easier for the
operators but now I find that for some
of the reports that need to be generated
from the access database program, the
date and time need to be back together in
one field.

So my question is, Is it possible to
take the two separate field (Date and
Time) and combine them into one field so
that the dates and times would look like
this:
01/31/02 06:30

By the way, I just discovered this
website! Thanks for being here!!! Its
a great resource!

Ri_ch
02-21-2002, 07:05 AM
=[Date]&[Time]PS.I hope those aren't the actual names of your fields

KKilfoil
02-21-2002, 07:38 AM
I find it much easier to always deal with dates using the Date type provided by Access, because you can analyse/manipulate it much easier.

You can combine the values and change it to a date type as followes:

DateAndTime: DateValue([date]) + TimeValue([time])

p.s. Like Ri_ch (or Rich?), I hope you didn't use the reserved names of date and Time as fieldnames

THERESA MARIE LOPEZ
02-21-2002, 11:09 AM
No, I wasn't useing "Date" and "Time" as the actual field names. I was actually using OperationDate and OperationTime. Wow, you guys are great (Hope they pay you "the big bucks")! That's exactly what I needed to know and it worked perfectly. Also, thanks for the very fast response!