The easiest way (I think):
Create a Calendary table, which contains all dates from some start date and into some reasonable future. Into this Calendary table you can add various additional info about date - e.g. week number (My advice is to have the week number in format yyyyww).
In your report source, you join this calendary table with your datasource - then you can have week numbers matching with dates in your report.
Those are date ranges, not dates, so I guess datepart("ww",date) or format(date,"ww") won't work for you. Some years will return week 53, which you can work around, and probably will have to do so in a table as well.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Ty both. Actually, I had a initial startdate as well. So, I guess, something like this may give me the week numbers? It seems very complicated though. Is there an easier coding?
=IIf([DateAssigned] is between [StartDay]+6 and [StartDate]+13,"Wk1"...) This will last for 10wks, and it could be cumbersome to write this whole formula out. Any better suggestions?
Best to always show some data and sometimes even better to show expected result. No one has any real idea about what [StartDay] data looks like.
Why not just datepart("ww",date) where date is a valid date and not the date function? Regardless it would be Between, not Is Between.
Not understanding how the expression can last for 10 weeks.
If you've got something complicated going on, might be better to use a table as suggested, but I haven't seen anything here that indicates any complexity.
Last edited by Micron; 04-08-2022 at 09:20 AM. Reason: added comment
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
You guys are wonderful!! ty very much. This works for me.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
I'd probably create my own function to parse that format, convert to dates and return a week number.
Hopefully the start date week is not different to end date week?
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba