View Full Version : Splitting Columns


m.akki
04-04-2007, 06:15 AM
I have a column in a table that contains the date and the time, i want to be able to split this column into 2 so i have one column for date and one for time

msgtime
03/07/2007 09:59:00
03/07/2007 10:02:00
03/07/2007 10:02:00
03/07/2007 10:04:00
03/07/2007 10:04:00
03/07/2007 10:39:00
03/07/2007 10:39:00

above is the column is a sample from the column i need to be split.

Any help is very appreciated

ColinEssex
04-04-2007, 06:16 AM
Look up the Left(), Mid() and Right() functions in Access help.

This will tell you how to do it

Col

PeterF
04-04-2007, 06:47 AM
For the given sample look up the datevalue and timevalue functions in the help.

boblarson
04-04-2007, 06:49 AM
Actually, you should just leave it as one. It will be easier to just display the column in queiries using format than having to try to concatenate them together when you need to try to do calculations or determine max dates with it.

Wherever you need to use just the date, or just the time, use:

Format([YourDateField],"m/d/yyyy") to display the date
Format([YourDateField],"hh:nn:ss") to display hours, minutes, and seconds