Hi, Is there a way to force a user to either choose a Monday as the start date or to calculate the next Monday from an entered start date so that the query always begins on a Monday?
Thank you.
Hi, Is there a way to force a user to either choose a Monday as the start date or to calculate the next Monday from an entered start date so that the query always begins on a Monday?
Thank you.
Last edited by ker9; 07-26-2011 at 12:42 PM.
I'll bet you can fine what you want on this link: http://www.pacificdb.com.au/Support/code_datetime.htm
Thank you - that was helpful.
This gets me the next monday.
I've been trying to add an IIF statement to it that will determine if the parameter date entered is a Monday, use that date, if not get the next Monday.Code:DateAdd("d",8-Weekday([dte],2),[dte])
I don't understand the syntax and can't get it..
Thanks for any assistance.Code:DateAdd("d",IIf(Weekday([dte],2)=2,2,8-Weekday([dte],2)),[dte])
EDIT:
I got it!
Code:IIf(Weekday([dte])=2,[dte],(DateAdd("d",8-Weekday([dte],2),[dte])))
Last edited by ker9; 07-26-2011 at 12:42 PM. Reason: Solution Found
Excellent! Thanks for posting back with your solution.