Filter using count()

  • Hi guys,

    i created a script that i want to use generate the resultset based on the value of count(X).

    Example

    Select

    Distinct PD.KPAIDS_NO, PD.LastName, PD.FirstName, PD.Registration_Date, PD.Date_Of_Birth

    ,PD.Marital_Status,CL.Clinic_Sites,convert(varchar(10),PCT.Test_Date, 101) as [Previous C13 Test Date]

    ,PCT.Previous_C13_Test,PCT.Test_Result,count(D.Date_Delivered) as 'Total Delivery'

    ....

    group by ......

    having count(Date_delivered) > 1

     but i get an error

    is there an alternative way to do this

    ?

  • Do you use "count(x)"?

  •  

    ok got it solved

     

  • It sure would be nice if you shared what you did to solve it... this is a forum, you know?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • " but i get an error" ... what a wonderful definition of problem. Makes it really easy to find solution.

    Here are some more ways how to ask for support (from my own experience, not made up):

    - I got some message but I didn't understand it, so I clicked Yes and now it doesn't work.

    - I am getting a message "You don't have permissions to.." and so on. Please fix it.

    - A button has disappeared from my screen, what should I do?

    Which button, or at least whats written there?

    I don't know.. it's the blue one I click every morning when I come to work. I really need it! (the "button" was a Terminal Server icon )

Viewing 5 posts - 1 through 4 (of 4 total)

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