Automatic Type Conversions

When a particular data-type is expected by an operation, the translation will attempt to convert it according to a set of rules.

From To How
Boolean Number FALSE becomes 0

TRUE becomes 1

Boolean DateTime Converts to number 0

Then uses Number to DateTime rules

Boolean String TRUE becomes ‘TRUE’

FALSE becomes ‘FALSE’

DateTime Number According to Excel date storage, and .NET DateTime.ToOADate
DateTime String Formats the date value according to: ‘yyyy-mm-dd hh:mi:ss.mmm(24h)’
DateTime Boolean Converts to number, then:

If the number is equal to 0: FALSE

Otherwise: TRUE

Number Boolean If number = 0: FALSE

Otherwise: TRUE

Number DateTime According to .NET DateTime.FromOADate
Number String Formatted roughly according to .NET ‘0.#’ format (actually done by database engine formatter, so it varies)
String Number Gets data-base to parse the string as a floating point number
String DateTime Gets data-base to parse the string as a date time value

This will vary between database back-ends

String Boolean If the string is case insensitively equal to ‘TRUE’: TRUE

Otherwise: FALSE

NULL Number 0
NULL DateTime Converts to number, then to datetime.

This is the datetime equivalent of number0

NULL String ” (empty string)

Related Articles