View Single Post
Old 10th July 2008, 14:35   #8
DimPrawn
Godlike
 
DimPrawn's Avatar
 
Join Date: Jul 2005
Posts: 10,101
Default

Quote:
Originally Posted by rsingh View Post
Assuming that you pass in @P and have validated it, then something like the following should work.

Code:
SELECT band_name
FROM bands
WHERE 
(@P = '#' AND LEFT(band_name,1) NOT LIKE [a-z])
OR 
(@P != '#'  AND LEFT(band_name,1) = @P)
Now that's what I'm talking about!

__________________
By the time you finish reading this sentence, the national debt will have risen by another £1,500 - which you or your children will have to repay.

Just so you know.
DimPrawn is offline   Reply With Quote