469,926 Members | 1,516 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

Query Help using SQL Server

Need help with a query.
I need to get a date from table1 where the symbol is equal to OQY7 but
the symbol in table table2 is OQY07.
How do I get it to look for the first three characters plus the fifth
character by skipping the fourth character?

Sep 11 '07 #1
1 1232
amj1020 (an**********@hotmail.com) writes:
Need help with a query.
I need to get a date from table1 where the symbol is equal to OQY7 but
the symbol in table table2 is OQY07.
How do I get it to look for the first three characters plus the fifth
character by skipping the fourth character?
Use the substring() function. Or left() and right(). All of them are
described in Books Online. I recommend you to look at all string functions,
because you don't know which one you may need next.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Sep 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Harvey | last post: by
12 posts views Thread by Joe Stanton | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.