Function reference
Convert a DateTime or Date to the equivalent “Microsoft” number of days after the base date 1899-12-30. This number is used by Excel and MS ODBC drivers.
Use his function when querying Date and DateTime columns in TXT/CSV files using SQL.

DateTimeToNumber( string )

Argument Description
string The DateTime or Date as literal string to convert into the number of days after the base date 1899-12-30

Data type: Decimal
Returns a number of type Decimal

Example 1
This expression returns 43197.47802083
DateTimeToNumber( ’2018-04-07 11:28:21’)

Example 2
This expression returns 43197
DateTimeToNumber( ’2018-04-07’)

Last modified: 23 May 2021

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment