Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521

    Quote Originally Posted by djclinton15 View Post
    it came back with the dates 1/7/2017 (Mon) to 1/13/2013 (Sat) next week's dates.
    I assume you mean Sunday, since the 7th is Sunday. Sounds like it's working correctly.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123
    Damn, no such luck. My 2-formulas above doesn't work when current date changes. Obviously, I just don't get it & should jut give it up!

  3. #18
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you attach the db here? They still return the expected dates for me:

    ?date() - Weekday(date()) + 8
    1/7/2018
    ?date() + (14 - Weekday(date()))
    1/13/2018
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #19
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    This is my test dB:
    Attached Files Attached Files

  5. #20
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123
    Steve, I extend my great appreciation for you taking the time & sending 'test_Mon2Sun' dbs. It's sort of what I'm looking for except (I should have mentioned) I need all 7-weekdays, "Sat" & "Sun." Your 'test_Mon2Sun' dbs Just run "Mon" thru "Fri." Might you be willing to revised & send back your 'test_Mon2Sun' dbs including "Sat" & "Sun?"

    I would really be grateful if you could! Thanks.
    Last edited by djclinton15; 01-05-2018 at 01:41 PM. Reason: Sentences reformatting

  6. #21
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123
    Quote Originally Posted by djclinton15 View Post
    Steve, I extend my great appreciation for you taking the time & sending 'test_Mon2Sun' dbs. It's sort of what I'm looking for except (I should have mentioned) I need all 7-weekdays, "Sat" & "Sun." Your 'test_Mon2Sun' dbs Just run "Mon" thru "Fri." Might you be willing to revised & send back your 'test_Mon2Sun' dbs including "Sat" & "Sun?"

    I would really be grateful if you could! Thanks.
    Oh and Steve, I need the weekdays starting with "
    Mon
    " thru "Sun".

  7. #22
    Join Date
    Apr 2017
    Posts
    1,681
    Tried you the syntax I adviced?

    Code:
    Date() - (Weekday(Date(),2) -1)
    to return Monday of current week.

    To get the query to return data from MyDate (without time part) interval from current ISO week:
    Code:
     ... WHERE MyDate Between (Date() - (Weekday(Date(),2) -1)) AND (Date() - (Weekday(Date(),2) -1) +6)
    Edit. When MyDate includes date AND time, then :
    1. when there never are MyDate values at midnight, you can use the WHERE clause as
    Code:
     ... WHERE MyDate Between (Date() - (Weekday(Date(),2) -1)) AND (Date() - (Weekday(Date(),2) -1) +7)
    ;
    2. Most general way which work always, will be:
    Code:
     ... WHERE MyDate >= (Date() - (Weekday(Date(),2) -1)) AND MyDate < (Date() - (Weekday(Date(),2) -1) +7)

  8. #23
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by djclinton15 View Post
    Steve, I extend my great appreciation for you taking the time & sending 'test_Mon2Sun' dbs. It's sort of what I'm looking for except (I should have mentioned) I need all 7-weekdays, "Sat" & "Sun." Your 'test_Mon2Sun' dbs Just run "Mon" thru "Fri." Might you be willing to revised & send back your 'test_Mon2Sun' dbs including "Sat" & "Sun?"
    OK, I did/have not change any code in the two date functions.

    However, I added conditional formatting, changed the names of the subforms and did some general cleanup.

    In the first dB, I only added a few dates for a couple of months for testing. I was only testing the functions.
    In this dB, I added dates from 11/1/2017 to 2/28/2018. (using the code in Module 2)

    Is this what you are looking for?
    Attached Files Attached Files

  9. #24
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123
    Steve, once again thanks very much for your time with me. One issue with the NextWeek Form you have starting from Sunday and ending on the following Sunday. Whereas, I wanted NextWeek's starting from next Monday and ending on the following Saturday. I.E. 1/8/2018 to 1/14/2018.

    In the qryNextWeek you have: Between fWeekStartMonday(Date()+7) And fWeekEndSunday(Date()+7)

    I tried making some changes, but had no luckBetween fWeekStartMonday(Date()+7) AndfWeekEndSaturday(Date()+6)

    Again, can you tell me what changes need to make in order to have NextWeek's form starting from next Monday and ending on the following Saturday?
    Last edited by djclinton15; 01-06-2018 at 10:13 AM. Reason: Revised

  10. #25
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In your Post #1, you say
    However I would like my weekday’s query to start from Monday and end on Sunday.
    Post #20 :
    It's sort of what I'm looking for except (I should have mentioned) I need all 7-weekdays, "Sat" & "Sun."
    Post #21:
    Oh and Steve, I need the weekdays starting with "
    Mon
    " thru "Sun".
    Post #24:
    Quote Originally Posted by djclinton15 View Post
    One issue with the NextWeek Form you have starting from Sunday and ending on the following Sunday. Whereas, I wanted NextWeek's starting from next Monday and ending on the following Saturday. I.E. 1/8/2018 to 1/14/2018.
    OK, I'm totally lost. You keep saying you want from MONDAY through SUNDAY.
    Then you give a date example 1/8/2018 to 1/14/2018.
    MONDAY is 1/8/2018 (on my calendar) and the following SUNDAY is 1/14/2018 (on my calendar)!!



    Since today is 1/6/2018 (Jan 6th):
    Last Week was 12/25/2017 (Monday) through 12/31/2017 (Sunday)
    This Week is 1/1/2018 (Monday) through 1/7/2018 (Sunday)
    Next Week will be 1/8/2018 (Monday) through 1/14/2018 (Sunday).

    Not sure what I am missing.
    Click image for larger version. 

Name:	NextWeek1.png 
Views:	17 
Size:	68.0 KB 
ID:	31971





    Again, can you tell me what changes need to make in order to have NextWeek's form starting from next Monday and ending on the following Saturday?
    Are you now wanting Monday through ** Saturday **?
    If so, just for Next Week? Or for Last, This AND Next weeks?


  11. #26
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123
    Steve, I'm sincerely sorry for such confusion. I was quite confused myself juggling between 2-separate dbs. In 1-dbs I needed a current week form & next week form both having the weekdays starting from Monday and ending on Sunday. Simultaneously, I also was working on a 2nd-dbs where I needed a current week form & next week form both having the weekdays starting from Sunday and ending on Saturday. I know how ludicrous it must sound, but actually is true. Needless to say, I had my head up my a**! With your help (along with others here) I think I have it all sorted out much thanks to the members here.

  12. #27
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    No problems..... glad you figured it out.


    So this is a pic of you??
    I always wondered who it was........
    Attached Files Attached Files

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 01-23-2016, 07:27 PM
  2. IsNull clarification
    By Jen0dorf in forum Access
    Replies: 6
    Last Post: 01-11-2016, 10:16 AM
  3. Clarification on distrubution
    By Jen0dorf in forum Access
    Replies: 3
    Last Post: 11-05-2015, 12:57 PM
  4. Just Looking for Clarification...
    By faythe1215 in forum Programming
    Replies: 5
    Last Post: 02-06-2015, 09:03 AM
  5. Replies: 3
    Last Post: 08-21-2012, 03:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums