Free Lessons Courses Seminars TechHelp Fast Tips Templates Topic Index Forum ABCD

 Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon More... What's New? Popular Links ------------ Access Courses Access Index Access TechHelp Access Forum Access Troubleshooter ------------ Excel Courses Excel Index ------------ Code Vault Testimonials Tip Jar

 Home > TechHelp > Directory > Access > DateDiff < Sorted Combo Box | Double Double >
 Back to DateDiff    Comments List
W vs WW Upload Images   Link   Email
 Sandra Truax         2 years ago
In the video it says W = weekday and ww = week, but when I use the following two codes, they both come back to 19. Am I doing something wrong? I was trying to see how many workdays until the end of the year.

dd: DateDiff("w",Date(),#12/31/2022#)
dw: DateDiff("ww",Date(),#12/31/2022#)
 Scott Axton             2 years ago From Microsoft Documentation: To calculate the number of days between date1 and date2, you can use either Day of year ("y") or Day ("d"). When interval is Weekday ("w"), DateDiff returns the number of weeks between the two dates. If date1 falls on a Monday, DateDiff counts the number of Mondays until date2. It counts date2 but not date1. If interval is Week ("ww"), however, the DateDiff function returns the number of calendar weeks between the two dates. It counts the number of Sundays between date1 and date2. DateDiff counts date2 if it falls on a Sunday; but it doesn't count date1, even if it does fall on a Sunday. Source:  DateDiff See Remarks
 Sandra Truax         2 years ago Thank you Scott for clearing that up!
 Scott Axton             2 years ago You bet Sandra!  Glad it helped.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in DateDiff.