View Full Version : New to the World! ASP VBScript Query problem?

04-24-2006, 07:00 PM
I am having problems with filtering my search parameter. I would like to be able to display my results by State, but also by State and CategoryValue(property type ie. single family home). With the present code It will display State and CategoryValue-not just State. I have 2 list menus one for entering state, another for Category. If I change the and to or it gives back the results for the state and also every record for the specfic category (ie. all single family homes in 50 states).
SELECT tblCLM_Items_Category_1.CategoryValue AS ParentCategoryValue, tblCLM_Items_Category.*, tblCLM_Items.*
FROM (tblCLM_Items_Category RIGHT JOIN tblCLM_Items ON tblCLM_Items_Category.CategoryID = tblCLM_Items.CategoryIDkey) LEFT JOIN tblCLM_Items_Category AS tblCLM_Items_Category_1 ON tblCLM_Items_Category.ParentCategoryID = tblCLM_Items_Category_1.CategoryID
WHERE tblCLM_Items.ExpiryDate >= NOW() AND tblCLM_Items.Activated = 'True' AND tblCLM_Items.ItemID LIKE 'value1' AND tblCLM_Items.CategoryIDkey LIKE 'value3' AND tblCLM_Items_Category.ParentCategoryID LIKE 'value4'

AND tblCLM_Items.StateProvince LIKE '%value2%' AND tblCLM_Items_Category.CategoryValue LIKE '%value6%'

AND tblCLM_Items.DateAdded LIKE 'value5'
ORDER BY tblCLM_Items.DateAdded DESC, tblCLM_Items_Category_1.CategoryValue, tblCLM_Items_Category.CategoryValue

04-25-2006, 08:13 AM
what value are you passing to tblCLM_Items_Category.CategoryValue ??

are they numerics