Results 1 to 3 of 3

Thread: Simple Query

  1. #1
    Join Date
    Feb 2003
    Location
    Cork, Ireland
    Posts
    4

    Unanswered: Simple Query

    I would appreciate any help on this query....I keep getting a data mismatch error.

    I have 3 columns in a table

    Bulletin_ID (Text)
    Date_Received (Date/Time)
    Status (Text)

    I want to write a query that will display the results something like this:


    Column 1 column2 column3

    January.............. 12............... 4
    february............. 15............... 5

    Column1 is the month that the bulletin has been received
    Column2 is the count of the bulletins for the month
    Column 3 is the count of the bulletins for the month where status = 'Completed'


    I cannot get the syntax right and would appreciate any help
    Thanks
    PatMac
    Last edited by patmac; 02-23-03 at 10:07.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    select format(date_received,"mmmm") as Month
    , count(bulletin_id) as Bulletins
    , sum( iif(status='Completed',1,0) ) as Completed
    from yourtable
    group by format(date_received,"mmmm")


    rudy
    http://rudy.ca/

  3. #3
    Join Date
    Feb 2003
    Location
    Cork, Ireland
    Posts
    4
    Thanks again Rudy,
    It worked perfectly

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •