> I have inherited an access db upsized to SQL7 that has some nasty column
> names, obviously won't ouput in CF without an alias. However is formating
> the SQL statement using a single quote returns the literal string
> within the
> quote and using a backtick to set it off generates an error in CF. So how
> does one specify the target column name for an alias?
>
> ex
>
> SELECT `home phone` AS PHONE
> FROM EMPLOYEE
> or
> SELECT `TBR@40` AS TBR
> FROM EMPLOYEE
> produce a syntax error and
>
> SELECT 'home phone' AS PHONE
> FROM EMPLOYEE
>
> produces 'home phone' in the field instead of the number
Use square brackets, otherwise it's a string...
SELECT [home phone] as Phone
Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists