i have table like this
name houseno address id
svr 3-13-01 hyd 0001
sht 3-13-02/b hyd 0008
sama 3-13-01/9 hyd 0009
raj 3-13-14 hyd 0003
prasf 3-13-20 hyd 0009
sameer 3-13-98 hyd 0035
raju 3-13-33/b hyd 00098
praveen 3-13-14/b hyd 00076
i wnt select only particular house no only
like :3-13-01 to 3-13-20 only
i want o/p like this .....orderded by houseno
name houseno address id
svr 3-13-01 hyd 0001
sama 3-13-01/9 hyd 0009
sht 3-13-02/b hyd 0008
raj 3-13-14 hyd 0003
praveen 3-13-14/b hyd 00076
prasf 3-13-20 hyd 0009
plz write quarie.........
Loading
HanookPosted Nov 4, 2013, 6:13 AM
SELECT * FROM Tablename
WHERE houseno between '3-13-01' and '3-13-20'
JAYRAMPosted Nov 4, 2013, 5:56 AM
Msg 105, Level 15, State 1, Line 3
yamini bPosted Nov 4, 2013, 5:22 AM
try this
select * from tablename where charindex('/',houseno)=0
this will fetch only houseno exculding this (' 3-13-01/9') type of format
thanks
yamini
HanookPosted Nov 4, 2013, 5:15 AM