Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Location
    Alaska
    Posts
    19

    Angry Unanswered: Date Range & Count usage problems in Query

    I have a query set up to return information from a table based on the DatePart i.e., DatePart("yyyy",[ReferenceDate]). The query also counts the number of orders during this year and Sums the Sales Totals This query works just fine. (it returns a total of 27 orders, which is correct)

    I also set up another query to use a Date Range, i.e., Between [BeginningDate] And [EndingDate]. Just to make sure everything was working correctly, I entered a starting date of 01/01/2002 and a ending date of 12/31/2002. When I compared the results to the above YEAR DatePart query they were very different.

    For one, the Count of orders was messed up (the orders were not "Counted") with the Date Range query and the calculated Totals were different.

    It seems very simple and straightforward, but something is awry here.

    Any helpful suggestions would be greatly appreciated.

    Cheers!

  2. #2
    Join Date
    Dec 2002
    Location
    Alaska
    Posts
    19

    Thumbs up Re: Date Range & Count usage problems in Query

    PROBLEM SOLVED - On the Query using the Date Range, I needed to use the WHERE statement in the Total row, instead of GROUP BY.

    ------------------------------------------------

    Thanks people.....


    Originally posted by cdakjat
    I have a query set up to return information from a table based on the DatePart i.e., DatePart("yyyy",[ReferenceDate]). The query also counts the number of orders during this year and Sums the Sales Totals This query works just fine. (it returns a total of 27 orders, which is correct)

    I also set up another query to use a Date Range, i.e., Between [BeginningDate] And [EndingDate]. Just to make sure everything was working correctly, I entered a starting date of 01/01/2002 and a ending date of 12/31/2002. When I compared the results to the above YEAR DatePart query they were very different.

    For one, the Count of orders was messed up (the orders were not "Counted") with the Date Range query and the calculated Totals were different.

    It seems very simple and straightforward, but something is awry here.

    Any helpful suggestions would be greatly appreciated.

    Cheers!

Posting Permissions

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