Query Builder - Filtering by two columns. is it possible? how

Joined
Aug 8, 2011
Messages
20
Location
Batangas City, Philippines
Programming Experience
Beginner
i try to filtered two columns to make SEARCHING a record more specific


what i did is LIKE @ YearLevel + '%' and LIKE @ Semester + '%'

but i got an error when i try to filter two columns
it says Data type error in expression
 
Absolutely you can filter on two columns, or as many as you like. The issue you're encountering would be because you are trying to use LIKE with data that is not text. The LIKE operator only makes sense for text. For non-text values you must use only appropriate operators, e.g. =, >, <, etc.
 
You're giving us little bits and pieces and expecting us to divine the rest. If you say that you do something then we have to assume that you're doing it. We can't tell if you're doing it right if you don't show us what you're doing. In this situation, a FULL and CLEAR explanation would include the EXACT SQL code you're using and the exact VB code you're using to execute it, plus more besides.

You really need to do some reading on basic database usage. A SELECT statement is the most basic SQL so you really should know the correct syntax. If you want to test one column for multiple values then you must either use multiple criteria of a proper list. Is the value '1,2' an Integer? No it isn't. If you want to use multiple values then you need multiple parameters.
 
Back
Top