November 15, 200421 yr This problem is baffling me, what am i doing wrong? i want to find records of reservations for the next 7 days. Sometimes this works, sometimes it doesn't depending on the day, I don't know what's wrong... Is there a better way to do this? If today is sunday the 14th, i want to find reservations beginning Monday the 15th to sunday the 21st if I do this find on a Tuesday, i want to see records beginning on wednesday for 7 days etc. My script is as follows: Find Next 7 Day's Reservations --------------------------- Allow User Abort [Off] Set Error Capture [On] Enter Find Mode [] Set Field [Clients::DateRequested; Let([ D = Get(CurrentDate); W = DayOfWeek(D)]; D - W + 1 & "..." & D + 7 - W )] Perform Find [] Go To Layout ["Tours Booked Next 7 days Report" (Clients)] Sort Records [Restore; No dialog] If [not Get(FoundCount)] Show Custom Dialog ["no records could be found.";"No records coould be found."] Show All Records End If If anyone can spot my mistake, that would be great, also if anyone has any ways to jazz this up with a better custom dialog popup or anything cool, i am all ears.. thank you! Hope others find the script useful when it works.. Michael
November 15, 200421 yr Author Let([ D = Get(CurrentDate); W = DayOfWeek(D)]; D - W + 1 & "..." & D + 7 - W )] would be??? Let([ D = Get(CurrentDate);]; D + 1 & "..." & D + 7)] That can't be right?:(
November 16, 200421 yr Yes that is right. If D = Current date then D + 1 = tommorrow and D + 7 = 7 days latter.
November 16, 200421 yr Author Thank you Ralph! Your explanation clicked for me too. I understand it now... Let( D = Get(CurrentDate); D + 1 & "..." & D + 7) was just what I needed!
Create an account or sign in to comment