Results 1 to 7 of 7

Thread: Date + 7

  1. #1
    Join Date
    Feb 2003
    Posts
    8

    Post Unanswered: Date + 7

    Hi,
    I'm trying to display the next 7 days from system date I'm using the following and it's not working

    =Now()+7 any ideas.....

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    More info

    On a form?

    if so use a text box (unbound)

    =Now()+7

    in the control source should work??? (Just tried it myself)

    When you say "its not working" - in what way -

    i are you getting an error message
    ii What is being displayed
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Feb 2003
    Posts
    8

    Re: More info

    Originally posted by garethdart
    On a form?

    if so use a text box (unbound)

    =Now()+7

    in the control source should work??? (Just tried it myself)

    When you say "its not working" - in what way -

    i are you getting an error message
    ii What is being displayed
    SELECT empshift.date, shifts.starttime, shifts.endtime, emp.first, emp.last
    FROM shifts INNER JOIN (emp INNER JOIN empshift ON emp.empid=empshift.empid) ON shifts.shiftid=empshift.shiftid
    WHERE (((empshift.date) Between empshift.date>=Now()-7 And Now()));

  4. #4
    Join Date
    Feb 2003
    Posts
    8
    The above should display the previous seven days but its only displaying records from today...

  5. #5
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    Between?

    ...WHERE (((empshift.date) Between empshift.date>=Now()-7 And Now()));


    Try this perhaps?>
    #####################################
    ...WHERE (((empshift.date) Between (Now()-7) And Now()));
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  6. #6
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    Use the DateAdd function:

    =dateadd("d",7,now())

  7. #7
    Join Date
    Feb 2003
    Posts
    8
    Originally posted by xander
    Use the DateAdd function:

    =dateadd("d",7,now())

    Thanks, that worked I can now display the previous 7 days and by using a plus sign the next 7 days. I inserted the query into my ASP page and it worked fine, I must just sort out layout issues...page below
    http://mulliganspub.brinkster.net/pr...playminus7.asp

    Thanks again....
    Pat

Posting Permissions

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