Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi Chapsis there a way to perform this in one query without the if?
declare @letter char(1)set @letter = '0'if not isnumeric(@letter) = 1 select description from mytable where left(description,1) = @letterelseselect description from mytable where (ascii(left(description,1)) < 65 or ascii(left(description,1)) > 90)
tia!cDc
Kristen
Test
22859 Posts
Posted - 2004-08-11 : 09:56:30
select description from mytable where (not isnumeric(@letter) = 1 AND left(description,1) = @letter)OR (isnumeric(@letter) = 1 AND (ascii(left(description,1)) < 65 or ascii(left(description,1)) > 90))Kristen