I usually write my WHERE clause like this:
WHERE (InvoiceTable.ClientName LIKE '%' + @ClientName + '%' )
But now I’d like to write a WHERE clause that will give me all the data that is less than an input, say for example 5. So if I want all the data with a PriceRatio of less than 5, my input into the textbox is 5.
How do I write this?
I think you want your
whereclause to be like so:Just be sure the data type is as you expect, for example if the input is always going to be an integer then the above will be fine unless it’s a large integer, and similarly with a decimal then the integer above in inappropriate.
See MSDN for details.