Skip to content
Contact us

DateTimeToNumber()

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 )

ArgumentDescription
stringThe 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

DateTimeToNumber( '2018-04-07 11:28:21')

This expression returns 43197.47802083

DateTimeToNumber( '2018-04-07')

This expression returns 43197