luvtitans50
MIS
I am getting this error;
Incorrect syntax near '–'
For this code and cannot figure out what am I doing wrong:
Select clientid, r.orderid, r.totalactive
–
CASE WHEN totalplaced > totalactive then totalactive else totalplaced end
as OpeningsPerOrder
From
(
select clientid, o.orderid,
SUM(Case when o.startdate < @enddate and oc.enddate > @startdate
then o.originalopenings end) as totalactive
from orders o
inner join ordercandidates oc on oc.orderid = o.orderid
where o.statusid in (144,157) and o.startdate IS NOT NULL
Group by clientid, o.orderid
)r
inner join
(
Select orderid, count(candidateid) as totalplaced
from ordercandidates where startingdate < @enddate and enddate > @startdate
Group by orderid
) r2 ON r2.orderid = r.orderid
group by r.clientid, r.orderid, totalactive
It points to this part of the code:
r.totalactive – CASE WHEN totalplaced > totalactive then totalactive else totalplaced END
Any suggestions? Thanks!!!
Incorrect syntax near '–'
For this code and cannot figure out what am I doing wrong:
Select clientid, r.orderid, r.totalactive
–
CASE WHEN totalplaced > totalactive then totalactive else totalplaced end
as OpeningsPerOrder
From
(
select clientid, o.orderid,
SUM(Case when o.startdate < @enddate and oc.enddate > @startdate
then o.originalopenings end) as totalactive
from orders o
inner join ordercandidates oc on oc.orderid = o.orderid
where o.statusid in (144,157) and o.startdate IS NOT NULL
Group by clientid, o.orderid
)r
inner join
(
Select orderid, count(candidateid) as totalplaced
from ordercandidates where startingdate < @enddate and enddate > @startdate
Group by orderid
) r2 ON r2.orderid = r.orderid
group by r.clientid, r.orderid, totalactive
It points to this part of the code:
r.totalactive – CASE WHEN totalplaced > totalactive then totalactive else totalplaced END
Any suggestions? Thanks!!!