Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Finding Next 7 Day's Reservations (records) script


This topic is 7312 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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?:(

Posted

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!

This topic is 7312 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.