date format help

mbergman

New Member
Joined
Jul 29, 2005
Messages
22
I have a text column in a table that contains dates and I was wondering if anyone knows how I convert it to date format so I can do calculations like:
10/10/05 - 10/8/05 = 2?

Here is how it is formated now:
2005-09-27 16:39:00.000

When I try to import it as a date, access doesn't recognize it and gives me import errors and when I try to change the format in design view, it deletes everything.

Any ideas?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You can convert this in a query. Assuming your table field is called ItemDate, build a query that includes all fields from the table except ItemDate. Instead, use this expression --
RealDate: DateSerial(Left([ItemDate],4),Mid([ItemDate],6,2),Mid([ItemDate],9,2))

Now, use the query insted of the table as your record source.
Note -- this assumes that you will always have 2 digits for the month and day components. If not, the expression is quite a bit more complex.

Denis
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,851
Members
449,051
Latest member
excelquestion515

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
Back
Top