lamarh Posted August 10, 2021 Report Share Posted August 10, 2021 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? Quote Link to comment Share on other sites More sharing options...
NiceDuck Posted August 11, 2021 Report Share Posted August 11, 2021 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. Quote Link to comment Share on other sites More sharing options...
ParkLoey Posted August 11, 2021 Report Share Posted August 11, 2021 A nice suggestion coming from @NiceDuck Dropping the function reference article here in case you need reference for using datepart: https://howto.caspio.com/function-reference/ Quote Link to comment Share on other sites More sharing options...
lamarh Posted August 15, 2021 Author Report Share Posted August 15, 2021 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.