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 2005 Forums
 Transact-SQL (2005)
 Using LIKE in the Select

Author  Topic 

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2008-07-14 : 08:32:40
I'm not sure how to get the right syntax, here is what I'm trying to do: I need to search on @JobNote using the LIKE keyword

@JobNote as nvarchar
as
set @NoteDate = datediff(day, '19000101', @notedate)
select cast(jobnoteevent.note as char(500))
from dbo.jobnoteevent
inner join event on event.eventguid = jobnoteevent.eventguid
inner join batch on batch.batchguid = event.batchguid
inner join job on job.jobguid = event.jobguid
inner join item on item.itemguid = event.itemguid
and jobnoteevent.note like @JobNote%

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-07-14 : 08:34:00
and jobnoteevent.note like @JobNote + '%'

Em
Go to Top of Page
   

- Advertisement -