Date and Time conversion

gpouliot

New Member
Joined
Jan 19, 2009
Messages
39
Hi,

I have two fields in my database TRAN_DATE and TIME

My TRAN_DATE is in the following format 20091215 (Text). I would like to format it in the following 12/15/2009?

And my TIME is the following 133502 (Text). I would like to format it in the following 13:35:02 HH:MM:SS

Any help would be appreciated.

Thanks
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,066
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Firstly, the word "Time" is a reserved word in Access and may cause you some issues in the future. You may wish to change the field name to avoid any issues. Here is a complete list of reserved words.

http://support.microsoft.com/kb/209187

As to the formatting, I think you can use the DateSerial and TimeSerial Formula in a query to manipulate the data. You will have to combine this formula with the Left and Right Formula to get the proper separations.

For information on these formulae and their syntax look at this site.

http://www.techonthenet.com/access/functions/index.php

Alan
 

Watch MrExcel Video

Forum statistics

Threads
1,122,564
Messages
5,596,863
Members
414,106
Latest member
Tigretto

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top