Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2004
    Posts
    16

    Unanswered: Query that pulls off records for This week, next week etc

    hi

    I am trying to design a query to pull off records for this week, next week, 2 weeks time etc..

    Can anyone help?
    I am getting no where !

    thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    At a minimum you can generate a query to pull records between to dates ...

    SELECT * FROM SomeTable WHERE (SomeDate BETWEEN #01/01/1980# AND #01/01/2001#);
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Sep 2004
    Posts
    16
    I really want to leave the user out of having to think..
    If u know wot i mean!

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    How many weeks are you looking to pull??? Is this gonna be a sliding window?
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Sep 2004
    Posts
    16
    This Week
    Next Week
    2 Weeks Time
    3 Weeks

    Thats all!

  6. #6
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    Would this not work?

    This week

    SELECT * FROM SomeTable WHERE (SomeDate BETWEEN #01/01/1980# AND (#01/01/2001#+7));

    Next week

    SELECT * FROM SomeTable WHERE (SomeDate BETWEEN (#01/01/1980#+7) AND (#01/01/2001#+14));

    two weeks time

    SELECT * FROM SomeTable WHERE (SomeDate BETWEEN (#01/01/1980#+14) AND (#01/01/2001#+21));

Posting Permissions

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