Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 01, 2013 04:32 PM by gimimex
Jan 01, 2013 01:55 PM|LINK
I have a table that has a PlanId field which has the values as below
Just want to get the count of PlanId's that has '-' charector in it (BP-GEN1,BP-MOT1 etc).
I tried this way..not sure whether this is the right way. not working..
select count(PlanID) as 'PlanID', CHARINDEX('-', PlanID) from InsDetails where DisId ="INGEN"
group by PlanID having count(CHARINDEX('-', PlanID) > 0
Please help me out
Jan 01, 2013 04:32 PM|LINK
select count(PlanID) as 'PlanID'
where DisId = 'INGEN' and
CHARINDEX('-', PlanID) > 0
Hope this helps.