Jump to content

check if specific time falls between multiple parameters


Recommended Posts

Our app allows teachers to request art lessons from a volunteer art program. The lessons are varying lengths and teachers can request a specific start time. I have a calculated field that gives me the end time based on the lesson length and requested start time. I need to check if the  calculated field falls between recess start/recess end, lunch start/lunch end or after school end. Can anyone help?

Link to comment
Share on other sites

If the time values for the recess start/recess end, lunch start/lunch end or after school end is static, you can try using another calculated field to check that for you by using a case statement and datepart function. 

Use the datepart to get the specific time values of the time you have from your original field. You should have an integer result from that which you can directly compare to the to your other  ecess start/recess end, lunch start/lunch end or after school end value.

Link to comment
Share on other sites

Thanks for the help!  I used another calculated field to check if the start time was before the end of recess/lunch AND if the end time was after the start of recess/lunch. If both are true, then the field returns a value ('lesson overlaps with recess', '... lunch'). Then I used javascript to prevent form submission if the value equals anything except 'ok to schedule' and also display an alert box with the value.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...