Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Filtering to build a view

Author  Topic 

groth.j
Starting Member

6 Posts

Posted - 2007-10-03 : 11:14:52
I am completely new to SQL and I am trying to filter a table on one column to build a view. The column is 5 characters. For most of the records only the first three characters are present the last two are spaces. I would like to search for the first three characters but include records that contain the last two characters. I am looking for 001, 006, 061, 064, 070, and 227.

[RD_ID] nvarchar length 5

I have tried ‘001’ or ‘001 ‘ or ‘001*’

Thanks for any help.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-03 : 11:33:21
SELECT *
FROM Table
WHERE RD_ID LIKE '001%'



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

groth.j
Starting Member

6 Posts

Posted - 2007-10-03 : 12:01:53
That worked great thank you.
Go to Top of Page
   

- Advertisement -