Hi,
can anybody, please help me out.

[B]select * from log where id <='%07%' [/B]

Am facing the syntax error, what is the actual query?

my id look like this:
1.mtg10kl
2.mtg07kl
3.mtg06kl
4.mtg09kl

I need the output this:
1.mtg07kl
2.mtg06kl

please help me out .thanks in advance

Recommended Answers

All 4 Replies

first of all, the percentage sign should have gone with the 'Like' wildcard. from your id's, you wont even get an answer if you had no errors because the comparison operator would search for exactly whats on the right side of the query but using the 'LIKE' keyword would produce A better result

hi please give me query....

There isn't a way to do what you are asking. LIKE won't work since you are looking for <=.
What you can do based on your sample is substring like this:

select * from log where convert(int,substring(log,4,2)) <= 7

You also can try your luck without the conversion to int.

hi, thanks...i got it , what i need.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.