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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare value from one table to another table

Status
Not open for further replies.

offdarock

Programmer
Sep 8, 2003
132
0
0
CA
<cfquery datasource=&quot;offdarock&quot; name=&quot;qViewThreads&quot; dbtype=&quot;oledb&quot;>
SELECT name, email, date, subject, messageId, updated
FROM forums
ORDER BY updated desc
</cfquery>
<cfquery datasource=&quot;offdarock&quot; name=&quot;qViewThreadsResponse&quot; dbtype=&quot;oledb&quot;>
SELECT threadId
FROM forumsResponse
WHERE threadId = messageId
</cfquery>

this is the line I am having trouble with

WHERE threadId = messageId

the messageId is from the first Query...how do I compare them

Craig
 
You can try this method:
<cfquery datasource=&quot;offdarock&quot; name=&quot;qViewThreads1&quot; dbtype=&quot;oledb&quot;>
SELECT name, email, date, subject, messageId, updated
FROM forums
ORDER BY updated desc
</cfquery>

<cfquery datasource=&quot;offdarock&quot; name=&quot;qViewThreadsResponse&quot; dbtype=&quot;oledb&quot;>
SELECT threadId
FROM forumsResponse
WHERE threadId = '#qViewThreads1.messageId#'
</cfquery>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top