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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Express ‘ and & in SQL statement?

Author  Topic 

lcpx
Yak Posting Veteran

54 Posts

Posted - 2005-11-17 : 12:11:19
Does any body knows how to express ' and & in SQL statement. We have a table contains data like: P&G and DO’S.

When I write the select statement, it always report error.

Select * from t where t.name = ‘P&G’ or t.name = ‘DO’S’

Could you please let me know how to put ‘ and & into SQL query. (I am using MSSQL server 2000)

Thanks very much for your help!

Vivaldi
Constraint Violating Yak Guru

298 Posts

Posted - 2005-11-17 : 12:49:30
add a second '

Select * from t where t.name = ‘P&G’ or t.name = ‘DO’'S’

________________________________________________

Drinking German Beer... fun.
Listening to an accordian player play ACDC...priceless
Go to Top of Page
   

- Advertisement -