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
 Double quote in beginning of record

Author  Topic 

gjja
Starting Member

17 Posts

Posted - 2005-12-14 : 05:25:15
Some of my records starts with a double quote, when I do a search for all records starting with A I can get all except the ones that start "A fine day ...

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-14 : 05:31:42
Try these

Select columns from yourTable where col like 'A%' or col like '"A%'

or

Select columns from yourTable where replace(col,'"','') like 'A%'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2005-12-14 : 05:34:24
Hi,
you can put an or condition

where record like 'A%' or record like '"A%'
Go to Top of Page

gjja
Starting Member

17 Posts

Posted - 2005-12-14 : 05:41:42
Any idea how to do that in asp.net vb code
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2005-12-14 : 09:02:40
In ASP.Net, u can use a ADO.Net
U can use a recordset or connection object (if u want more details on those I can elaborate, or u can find it from MSDN)

U have to create the string to be passed to SQL server.
The created string should look like madhivanan / gjja suggests once created.
ie. U may need to concatenate the Text and the data from controls (as text box to which the user keys in the starting search letter(s))
It would be like :
........
sSQL = "Select * from UrTbl where srchCol like '" & txtSearch.Text & "%'
rs.open sSQL, URConn
........





Go to Top of Page
   

- Advertisement -