
447
DEVELOPING
COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Las
t
upda
te
d 8/5/2010
Using Queries of Queries with dates
If you create a query object with the
QueryNew
function and populate a column with date constants, ColdFusion stores
the dates as a string inside the query object until a Query of Queries is applied to the query object. When ColdFusion
applies a Query of Queries to the query object, it converts the string representations into date objects.
Query of Queries supports date constants in SQL and ODBC format, as follows:
•
SQL format
: Dates, times, or timestamps in one of the following format:
•
Date string
:
yyyy-mm-dd
, for example, 1955-06-13.
•
Time string
:
hh:mm:ss[.[nnn]]
, for example, 14:34:30.75.
•
Timestamp string
:
yyyy-mm-dd hh:mm:ss[.[nnn]]
, for example, 1924-01-14 12:00:00.000.
•
ODBC format
: Dates, times, or timestamps in one of the following format:
•
Date string
:
{d 'value'}
, for example, {d '2004-07-06'}.
•
Time string
:
{t 'value'}
, for example, {t '13:45:30'}.
•
Timestamp string
:
{ts 'value'}
, for example, {ts '2004-07-06 13:45:30'}.
LEADING
LEFT
LEVEL
LIKE
LOCAL
LOWER
MATCH
MAX
MIN
MINUTE
MODULE
MONTH
NAMES
NATIONAL
NATURAL
NCHAR
NEXT
NO
NOT
NULL
NULLIF
NUMERIC
OCTET_LENGTH
OF
ON
ONLY
OPEN
OPTION
OR
ORDER
OUTER
OUTPUT
OVERLAPS
PAD
PARTIAL
POSITION
PRECISION
PREPARE
PRESERVE
PRIMARY
PRIOR
PRIVILEGES
PROCEDURE
PUBLIC
READ
REAL
REFERENCES
RELATIVE
RESTRICT
REVOKE
RIGHT
ROLLBACK
ROWS
SCHEMA
SCROLL
SECOND
SECTION
SELECT
SESSION
SESSION_USER
SET
SMALLINT
SOME
SPACE
SQL
SQLCODE
SQLERROR
SQLSTATE
SUBSTRING
SUM
SYSTEM_USER
TABLE
TEMPORARY
THEN
TIME
TIMESTAMP
TIMEZONE_HOUR
TIMEZONE_MINUTE
TO
TRAILING
TRANSACTION
TRANSLATE
TRANSLATION
TRIM
TRUE
UNION
UNIQUE
UNKNOWN
UPDATE
UPPER
USAGE
USER
USING
VALUE
VALUES
VARCHAR
VARYING
VIEW
WHEN
WHENEVER
WHERE
WITH
WORK
WRITE
YEAR
ZONE