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 |
|
ann
Posting Yak Master
220 Posts |
Posted - 2010-05-01 : 19:41:40
|
| does anyone know how I can search based on the last 4 digits of an int column?@Num intselect * from tablewhere intcolumnlast4digits = @numthanks |
|
|
ms65g
Constraint Violating Yak Guru
497 Posts |
Posted - 2010-05-01 : 23:34:04
|
| [code]SELECT * FROM tableWHERE RIGHT(CAST(intcolumnlast4digit AS VARCHAR(18)), 4) = @num;[/code] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-05-02 : 00:25:50
|
[code]select * from tablewhere intcolumnlast4digits % 10000 = @num[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-07 : 10:06:03
|
| If you want to make use of indexselect * from tablewhere intcol like '%'+cast(@num as varchar(10))MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|