LyndonOHRC
Programmer
I know this should be simple but have been banging my head on the wall for a while now.
I have a list of text values and wanted to use the IN (#var#) method in my query but I'm getting nowhere...
I'm using a small access table on a shared CF 7 site at hostmysite.com
Queries I've tried and results... I'm so confused, any help appreciated.
What I've been trying to do is:
However, it returns 0 records.
When I couldn't figure it out I used some actual data from the database and get these results:
returns 1 record
returns 2 records
returns 0 records
Thanks
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
I have a list of text values and wanted to use the IN (#var#) method in my query but I'm getting nowhere...
I'm using a small access table on a shared CF 7 site at hostmysite.com
Queries I've tried and results... I'm so confused, any help appreciated.
What I've been trying to do is:
Code:
<cfquery...../>
<cfset NIDList=ValueList(GetOwners.NID)
<cfquery name="GetMares" datasource="HDRegistry">
select NID, HorseName
From Mares
Where NID IN ('#NIDList#')
</cfquery>
When I couldn't figure it out I used some actual data from the database and get these results:
Code:
<cfquery name="GetMares" datasource="HDRegistry">
select NID, HorseName
From Mares
Where NID ='EH1221'
</cfquery>
Code:
<cfquery name="GetMares" datasource="HDRegistry">
select NID, HorseName
From Mares
Where NID ='EH1221' or NID='K81105'
</cfquery>
Code:
<cfquery name="GetMares" datasource="HDRegistry">
select NID, HorseName
From Mares
Where NID IN ('EH1221,K81105')
</cfquery>
Thanks
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey