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)
 Operator Equals Modulo?

Author  Topic 

mikebird
Aged Yak Warrior

529 Posts

Posted - 2009-09-15 : 11:22:45

What does it mean when I get this error for this script?

Msg 403, Level 16, State 1, Line 2
Invalid operator for data type. Operator equals modulo, type equals varchar.


select distinct
Code, vwKC60.Description
FROM vwSHKC60BaseCode vwKC60
LEFT JOIN Diagnosis di ON vwKC60.Code = di.Diagnosis
LEFT JOIN Demographic de ON di.PatientNumber = de.PatientNumber
LEFT JOIN Episode ep ON ep.ID = di.ParentID
LEFT JOIN Locations AS lo ON ep.Location = lo.Coded
where DiagnosisDate between '01-06-2009' and '31-08-2009'
AND (di.Provisional = 0)
AND (di.RecordDeleted = 0)
AND ep.Location = 'WMUH'
AND ep.Location = 'WMUH'
OR (lo.BelongsTo LIKE ''%'WMUH'%'')
GROUP BY
vwKC60.Code, vwKC60.Description

mikebird
Aged Yak Warrior

529 Posts

Posted - 2009-09-15 : 11:29:39
Is it to do with BelongsTo ? Never seen it before, ever, and eliminating it seems to kill the error...
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-09-15 : 15:33:33
BelongsTo LIKE '%WMUH%'



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2009-09-16 : 05:27:36
You're right
Go to Top of Page
   

- Advertisement -