Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

query error. pls help..

0 views
Skip to first unread message

Joe Science

unread,
Nov 21, 2003, 1:36:16 PM11/21/03
to
I am getting and error with this in the query. (ORDER BY #Variables.OrderBy# #Variables.Direction#).

the error says (ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'profilesid'.

if i leave (ORDER BY #Variables.OrderBy# #Variables.Direction#) out of the query it works fine but then cannot sort the records descending or ascending.


<!--- here is my code--->


<cfif isDefined('URL.StartRow') OR isDefined('Form.StartRow')>
<cfif isDefined('URL.StartRow')>
<cfset StartRow=URL.StartRow>
<cfelse>
<cfset StartRow=Form.StartRow>
</cfif>
<cfelse>
<cfset StartRow=1>
</cfif>

<cfif isDefined('URL.OrderBy') OR isDefined('Form.OrderBy')>
<cfif isDefined('URL.OrderBy')>
<cfset OrderBy=URL.OrderBy>
<cfelse>
<cfset OrderBy=Form.OrderBy>
</cfif>
<cfelse>
<cfset OrderBy="profilesid">
</cfif>

<cfif isDefined('URL.Direction') OR isDefined('Form.Direction')>
<cfif isDefined('URL.Direction')>
<cfset Direction=URL.Direction>
<cfelse>
<cfset Direction=Form.Direction>
</cfif>
<cfelse>
<cfset Direction="ASC">
</cfif>

<CFQUERY name="GetRecords" dataSource="limited" >
SELECT *, profiles.photo AS photo
FROM request_form INNER JOIN
profiles ON request_form.profilesid = profiles.profilesid
WHERE action_status='Requested'
ORDER BY #Variables.OrderBy# #Variables.Direction#
</CFQUERY>

<!---END--->


Scott Stroz

unread,
Nov 21, 2003, 2:32:54 PM11/21/03
to
I answered your question in this thread.

Please do not post the same question in different forums:

Scott F Stroz
Frontal Grey Technologies
------------------------------------
I would rather have a bottle in front of me, than a frontal lobotomy.

Referring URLs
http://webforums.macromedia.com/coldfusion/messageview.cfm?catid=3&threadid=732190


0 new messages