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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,159
Office Version
  1. 365
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,127,592
Messages
5,625,684
Members
416,127
Latest member
MALEPINZON

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