Solved

SQL Query

Posted on 2009-07-09
4
184 Views
Last Modified: 2012-05-07
Hey Experts!
I need to write a SQL query to filter out some records. I need all records that start with "MED" and are 8 characters long.
 

something along the lines of:
 

select * from TABLE where len(RECORD) = 8 and Begins with "MED"
 

Urgent! Thanx!!!

Open in new window

0
Comment
Question by:calbackup
  • 3
4 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 24820384
select * from TABLE where len(RECORD) = 8 and RECORD like '%MED?%'
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 24820396
select * from TABLE where len(RECORD) = 8 and RECORD like 'MED%'
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 24820399
RECORD is nothing but you filed name that you want to check for length and start characters
0
 

Author Closing Comment

by:calbackup
ID: 31601945
Thanx dude! worked like a charm
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now