"IN" sql query returning Empty set

The following sql query (simplified to get relevant with the error) -
"select tbldt.* from tabl tbldt where tbldt.DatingID in ( 63, 64, 67, 50)"
returns empty set, Although the table tabl contains the record with DatingID 67 .
Actually it should return  all the rows  having DatingID like anythng in the list.

Thanks & Regards,
LVL 2
Jack020800Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

momi_sabagCommented:
your query is correct
are you sure that DatingID is a number and not a string? maybe it's a conversion issue
0
Haris DulicCommented:
try like this :

"select tbldt.* from tabl tbldt where rtrim(bldt.DatingID) in ( '63', '64', '67', '50')"
0
UnifiedISCommented:
If the above doesn't correct it, I'd suggest posting the entire query in case you omitted a part that is causing the incorrect result set.
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

tbsgadiCommented:
Hi Jack,

See what happens if you just do
"select .* from tbldt where tbldt.DatingID in ( 63, 64, 67, 50)"


Good Luck!

Gary
0
Jack020800Author Commented:
Thanks for the all the post here, I reformation of the main wuery has solved the problem.

Thanks & Regards,
0
Haris DulicCommented:
than assign and close the question....;)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.