Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Date Problem (2003)

    I have a table of actions performed, and the dates completed. I want to be able to see how many where completed each week. I have created a query which includes the date. I have created two extra columns in the query to give me todays date (Now()), and last weeks date (Date()-7). I named these columns This Week and Last Week. I have used a criteria in the Dates column which is :- Between [ThisWeek] and [LastWeek]. When I run the query, I am asked to enter data for ThisWeek and LastWeek.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date Problem (2003)

    You state that you named the columns "This Week" and "Last Week" with a space before week, but in the parameters, you don't have a space. Is that a typo?

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Date Problem (2003)

    No, in the parameters I don't have spaces

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date Problem (2003)

    Then you should insert them. The parameters must be EXACTLY the same as the column names.

  5. #5
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Date Problem (2003)

    Sorry, it was just my post that had the typo. Both the fields and the criteria match.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date Problem (2003)

    Try creating two queries: first create a query with the two extra columns, but without Between ... and ... in the criteria.
    Save this query, then create a new query based on the first one, and add the Between ... and ... criteria to the new query.

  7. #7
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Problem (2003)

    If you use:

    Between Date() And Date()-7

    as criteria rather than working out ThisWeek and LastWeek it will work in one step

    John

  8. #8
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Date Problem (2003)

    Thanks John, I'll try that. Thanks Hans also, your method does work.

Posting Permissions

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