Caution: ColdFusion Zero Date vs. SQL Zero Date

<cfquery name="qZeroDate" datasource="...">
 
	<!--- Select the SQL zero date. --->
	SELECT
		( 'SQL Zero Date' ) AS label,
		( CAST( 0.0 AS DATETIME ) ) AS the_date,
		( 0.0 ) AS the_float
 
	UNION
 
	<!---
		Select the DateFormat() ColdFusion zero date with
		default date-mask.
	--->
	SELECT
		( 'CF Zero DateFormat( )' ) AS label,
		(
			<cfqueryparam
				value="#DateFormat( 0 )#"
				cfsqltype="CF_SQL_TIMESTAMP"
				/>
		) AS the_date,
		CAST(
			<cfqueryparam
				value="#DateFormat( 0 )#"
				cfsqltype="CF_SQL_TIMESTAMP"
				/>
			AS FLOAT
		) AS the_float
 
	UNION
 
	<!---
		Select the TimeStamp ColdFusion zero date (ie. Let
		CFQueryParam make the conversion for us.
	--->
	SELECT
		( 'CF Zero TimeStamp' ) AS label,
		(
			<cfqueryparam
				value="0"
				cfsqltype="CF_SQL_TIMESTAMP"
				/>
		) AS the_date,
		CAST(
			<cfqueryparam
				value="0"
				cfsqltype="CF_SQL_TIMESTAMP"
				/>
			AS FLOAT
		) AS the_float
 
	UNION
 
	<!--- Select the ColdFusion zero date with full date maks. --->
	SELECT
		( 'CF Zero DateFormat( full )' ) AS label,
		(
			<cfqueryparam
				value="#DateFormat( 0, 'full' )#"
				cfsqltype="CF_SQL_TIMESTAMP"
				/>
		) AS the_date,
		CAST(
			<cfqueryparam
				value="#DateFormat( 0, 'full' )#"
				cfsqltype="CF_SQL_TIMESTAMP"
				/>
			AS FLOAT
		) AS the_float
</cfquery>

For Cut-and-Paste