below. I was going to combine those queries into a stored procedure and
call the procedure. ;-)
<cfquery name="qry_selectIntoTemp" datasource="#request.dsn#">
SELECT *
INTO ##temp2
FROM tbl_contacts
</cfquery>
<cfquery name="qry_updateTemp" datasource="#request.dsn#">
UPDATE ##temp2
SET companyName=ttoOfficeName
WHERE companyName is null and ttoOfficeName is not null
</cfquery>
<cfquery name="qry_getContacts" datasource="#request.dsn#">
SELECT companyName, ttoOfficeName
FROM ##temp2
ORDER BY convert(nvarchar, companyName)
</cfquery>
<cfdump var="#qry_getContacts#">
Deanna Schneider wrote:
> SELECT
> CASE WHEN companyName is not null THEN companyName
> ELSE WHEN ttoOfficeName is not null THEN ttoOfficeName
> ELSE 'n/a' END as SiteName
> FROM yourtable
> ORDER BY SiteName
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]