Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query of Queries How?

Status
Not open for further replies.

Gill1978

Programmer
Joined
Jun 12, 2001
Messages
277
Location
GB
Hi!

Is it possible to add the dates from a second query to the result set from a first query so i can sort the joint result set by the new column?

I have been advised to do a query of queries to sort the result set by the new column, but i have no idea how to do that ... and is it just resctricted to CF5??

 
Query of queries, (called CFSQL in some documentation) is new as of ColdFusion 5. It allows you to use an in-memory recordset as the datasource for a second query. In the example you are giving, if your first query is called "GetProjects", your second query would look like this:
Code:
<cfquery dbtype=&quot;query&quot; name=&quot;GetProjectsSorted&quot;>
SELECT *
FROM GetProjects
ORDER BY DistDateInviteSent
</cfquery>
The Macromedia livedocs regarding the query of queries is online here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top