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.
Author |
Topic |
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2014-07-08 : 14:45:34
|
I have number column projNo, how to validate the first digit of projnoif (projno,1,1) =1 then begin ---Apply this logic endelse begin ---Apply diff logic endThanks a lot for the helpful info |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-07-08 : 14:55:33
|
Not sure if there's a math way to do it, but here you go:if left(convert(varchar(20), @i), 1) = '1'Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2014-07-08 : 16:00:31
|
IF CAST(ProjNo AS CHAR(1)) = '1' Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
|
|
|