Conversion of Date to Number

marystewart78

Registered User.
Local time
Today, 16:00
Joined
Aug 16, 2005
Messages
30
Hi folks,

I'm sure this is pretty simple to do but I'm stuck - please help if you can!

I have a table with a date field and once the date is entered I would like it to automatically generate a reference number in the Ref No field which is the date as a number in reverse order ie 16th August 2005 would become 20050805 - how can I do this???

Many Thanks,

Mary
 
In a query....

SELECT Format([YourDateField],"yyyymmdd") AS YourRefField
FROM tblYourTableName;

You wouldn't want to store the result of a calculated field in a table, would you, as that would be bad practice....


marystewart78 said:
... ie 16th August 2005 would become 20050805 - how can I do this???

ie 16th August 2005 would become 20050816
 
Last edited:

Users who are viewing this thread

Back
Top Bottom