Counting

  • I have a question:

    A database, with the following columns: keyholderid, event, datetime.

    Basically, a keyholder can have many events associated with him/her on the same day.

    What i'm looking to do is to count the number of datetimes associated with a specific event per day, e.g. event x occurs y times on date z.

    Can anyone help?

    Cheers

  • Maybe I'm missing the point but...

    Select COUNT(ColName) From Table

    Where

    Event = 'x'

    If you want the number of each event then

    Select COUNT(ColName), EventName From Table

    Where

    Event = 'x'

    Group By EventName

    Cheers,

    Crispin

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • Thanks - that set me of in the right direction.

    I'm all sorted now.

Viewing 3 posts - 1 through 2 (of 2 total)

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