Results 1 to 4 of 4

Thread: query help

  1. #1
    Join Date
    Sep 2008
    Posts
    101

    Unanswered: query help

    i have a query i created for a system awhile back in SQL on acces, this is the coding:
    SELECT [Table].[owner], Count(*) AS Totalcalls
    FROM [table]
    GROUP BY [table].[owner], [table].[date]
    HAVING ((([table].[date])=[Enter Date]));

    im wondering how would the code be written if im also including [Sale] which is a tick box, from the ones its counted how many of them have [sale]=-1 and group them into each owners results.
    thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    SELECT t.owner
         , COUNT(*) AS Totalcalls
         , COUNT(IIF(t.sale=-1,'BOOYAH!!',NULL) AS ticks
      FROM Table AS t
     WHERE t.date = [Enter Date]
    GROUP 
        BY table.owner
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by r937
    Code:
    ...
         , COUNT(IIF(t.sale=-1,'BOOYAH!!',NULL) AS ticks
    ...
    <3
    George
    Home | Blog

  4. #4
    Join Date
    Sep 2008
    Posts
    101
    cheers all

Posting Permissions

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