| Author |
Topic |
|
David Adedeji
Starting Member
14 Posts |
Posted - 2006-03-07 : 13:01:03
|
| I will like a query that search for hypen (-) in a field called id |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2006-03-07 : 13:06:21
|
| SELECT mt.id FROM dbo.MyTable AS mt WHERE CHARINDEX('-', mt.id) > 0 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-08 : 01:14:12
|
| orWhere mt.id like '%-%'MadhivananFailing to plan is Planning to fail |
 |
|
|
David Adedeji
Starting Member
14 Posts |
Posted - 2006-03-08 : 10:03:07
|
| Thanks anyway but I already tried that and it didn't work |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-08 : 10:10:31
|
quote: Originally posted by David Adedeji Thanks anyway but I already tried that and it didn't work
What did you try?Post some sample data and expected resultMadhivananFailing to plan is Planning to fail |
 |
|
|
David Adedeji
Starting Member
14 Posts |
Posted - 2006-03-31 : 10:37:02
|
| Where mt.id like '%-%' |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2006-03-31 : 10:58:59
|
try '%[-]%'Corey Co-worker on children "...when I have children, I'm going to beat them. Not because their bad, but becuase I think it would be fun ..." |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-03-31 : 11:08:41
|
| David,>> Where mt.id like '%-%'This is not the complete answer for what Madhivanan asked [Post some sample data and expected result]If you want something to be answered, please be more descriptivehttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61253Srinika |
 |
|
|
CLages
Posting Yak Master
116 Posts |
Posted - 2006-04-01 : 22:08:09
|
| Dont Forget Like Works only in Char, varchar,if your field is an INT will not WorkC.lages |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-04-01 : 23:26:44
|
quote:
Dont Forget Like Works only in Char, varchar,if your field is an INT will not Work
Do INT Datatype can store '-' ? i dont think so.. If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2006-04-02 : 06:23:55
|
| could it be...where id<0rockmoose |
 |
|
|
|