Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Posts
    101

    Unanswered: Parameter Query on SQL

    I'm trying to run a parameter query so it asks for a date between and a date to end and then to display all the results in grouped for on a report.
    thanks to healdem earlier he gave me help on the sql query. Now though when i add a parameter to the query healdem made in design view (BETWEEN [START DATE] AND [END DATE]) it shows every result and counts them as one so you get all the records brought back as individual records if the date is different.

    this is the sql code healdem wrote:
    SELECT mytable.source, count(mytable.source) as NoContactsBySource
    FROM mytable
    group by mytable.source

    any help on this would be appreciated.
    thanks

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    If you look at the SQL created when you added that, it probably added the field to both the SELECT and GROUP BY clauses. You just want it in the WHERE clause. In design view, you can achieve that by changing GROUP BY to WHERE.
    Paul

  3. #3
    Join Date
    Sep 2008
    Posts
    101
    thanks pbald your a star.
    cheers guys

  4. #4
    Join Date
    Sep 2008
    Posts
    101
    Quick Question again....i've added a tick box to the table and i want it to show out of all the results from the above query how would i show how many of those in the next column are ticked?

  5. #5
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I'm not sure I'm clear on what your data looks like or the result you want, but try adding that field to the query and selecting GROUP BY for it in the Totals row.
    Paul

Posting Permissions

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