Stored proceedure and cursor

  • OK i did like this but now this shows me those records too which do not match...mean when their counter field is 0...

    select TOP 5 COMPANY,CategoryName,comp_kws,locStr,

    len(COMPANY) - len(replace(COMPANY, 'ltd', '')) as cntcmp ,

    len(CategoryName) - len(replace(CategoryName, 'ltd', ''))

    as cntcat,

    len(comp_kws) - len(replace(comp_kws, 'ltd', ''))

    as cntkey,

    len(locStr) - len(replace(locStr, 'ltd', ''))

    AS cntStr

    from vwSearchResult

    GROUP BY COMPANY,CategoryName,comp_kws,locStr

    order by cntcmp DESC,cntcat DESC,cntkey DESC,cntStr DESC

    In this case cntStr is Zero for all five records.I want to check if it is Zero then Do not show any thing.how it could be.....when i put where cntStr>0..it give me error

  • select ...

    from vwSearchResult

    where (len(COMPANY) - len(replace(COMPANY, 'ltd', '')) + len(CategoryName) - len(replace(CategoryName, 'ltd', '')) + len(comp_kws) - len(replace(comp_kws, 'ltd', '')) + len(locStr) - len(replace(locStr, 'ltd', ''))) > 0

    GROUP BY ...

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Very Good Job

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply