thunderain
Programmer
This peice of code works somewhat. I recieve two numbers from a textbox in the previous screen such as (AM79C30A, AM79C978). I want to get all the records (from AMD_Part_Number field in filtron table) that match either number.
It depends on what order you put them in. I put two numbers in (AM79C30A, AM79C978) it gives you what you want, 26 records for the first number and 2 records for the second. Great!!! BUT...if I switch the numbers, (AM79C978, AM79C30A) I only pick up the two records for the first number and not the 26 records for the second. This is strange. What would cause this?
(If i only put one number, it crashes, but I assume I need an if statement to handle that, either one number or two)
<cfquery name="filtran" datasource="filtran" dbtype="ODBC">
SELECT Filtran_Part_Number, Description, On_Web_Site, Approved
FROM filtran
WHERE
<cfif #form.Filtran_Part_Number# is not "">
(AMD_Part_Number LIKE '%#ListGetAt(form.Filtran_Part_Number, 1,","
#%') or
(AMD_Part_Number LIKE '%#ListGetAt(form.Filtran_Part_Number, 2)#%')
</cfif>
</cfquery>
Has anyone any ideas?
Thank you
It depends on what order you put them in. I put two numbers in (AM79C30A, AM79C978) it gives you what you want, 26 records for the first number and 2 records for the second. Great!!! BUT...if I switch the numbers, (AM79C978, AM79C30A) I only pick up the two records for the first number and not the 26 records for the second. This is strange. What would cause this?
(If i only put one number, it crashes, but I assume I need an if statement to handle that, either one number or two)
<cfquery name="filtran" datasource="filtran" dbtype="ODBC">
SELECT Filtran_Part_Number, Description, On_Web_Site, Approved
FROM filtran
WHERE
<cfif #form.Filtran_Part_Number# is not "">
(AMD_Part_Number LIKE '%#ListGetAt(form.Filtran_Part_Number, 1,","
(AMD_Part_Number LIKE '%#ListGetAt(form.Filtran_Part_Number, 2)#%')
</cfif>
</cfquery>
Has anyone any ideas?
Thank you