Convert Date to General number

simon4amiee

Registered User.
Local time
Today, 23:52
Joined
Jan 3, 2007
Messages
109
Is it possible to easily convert 02/02/2015 15:30:00 to 201502021530 in a query?
 
use the format command

format(mydate,"yyyymmddhhnn")

which is text
and to convert this to a number

surround with clng

clng(format(mydate,"yyyymmddhhnn"))
 
Errr that number is beyond the range of Long.
 
OK - cdbl then. my bad

Although for all intents and purposes it will sort the same way as text as a number and I can't see you wanting to add or divide it so the conversion to number is probably academic anyway
 
The date already is a number - one of type Double. What is the purpose of this suggested conversion?
 

Users who are viewing this thread

Back
Top Bottom