Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating / removing data from fields

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
Please could someone assist.

I have an old diary that I want to convert to access format.

When I export it and open it in access, the records in the field 'STARTDAT':

1998-04-02 10:00:00.000000000 (STARTDAT is currently formatted as a text field - if i try to change this to date field it deletes all the receords. I have manually changed one recording removing the 9 zeros and then it will accept a change to date format - so I guess I need a way to trim the end of the records).

I would ideally like ot to be reformatted to 10.00.00 02/04/1998

What is the best way to do this - there are 60000 records

Many thanks Mark
 
I'd use an update query:
SQL:
UPDATE yourTable SET STARTDAT=Left(STARTDAT,19) WHERE Len(STARTDAT)>19
And then you may alter the column to type DateTime.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top