AnsweredAssumed Answered

How to check if a Date & Time falls within a range via nintex form?

Question asked by bimi82 on Aug 21, 2018
Latest reply on Aug 31, 2018 by emha

Hello All

 

I am in process in creating a form for booking a car from the pool.
Now of course it is not ideal to book the same car between a date/time when it is already booked by somebody else.

 

Lets take an example:

 

 

Now, nobody else should be able to book the same car on the same date/time and between the times.

However, the user can book the same car outside the date/time frame.


What is the best (easiest) way to perform such checkup?

 

On the form I have used the calculated field to show the duration of the selected FromDate + UntilDate

 

dateDiffDays(FromDate, UntilDate) + " days,  " + (dateDiffHours(FromDate, UntilDate)-24*dateDiffDays(FromDate, UntilDate)) + " hrs,  " + (dateDiffMinutes(FromDate, UntilDate)-(60*dateDiffHours(FromDate, UntilDate))) + " mins  "

 

Notice, although the calculation is same but the format is not!
On the form the hrs + mins are shown with one zero whereas on the list calculated value is with two zeros

 

This is the calculated value in list view:

=DATEDIF(FromDate,UntilDate-(MOD(FromDate,1)>MOD(UntilDate,1)),"d")&" days, "&TEXT(MOD(UntilDate-FromDate,1),"hh "" hrs, "" mm "" mins""")

 

Just saying that when comparing the duration field, it will not pick up as being "identical".

Outcomes