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
Section titled “Example 1”DateTimeToNumber( '2018-04-07 11:28:21')
This expression returns 43197.47802083
Example 2
Section titled “Example 2”DateTimeToNumber( '2018-04-07')
This expression returns 43197