Using Formula to do time comparison

Happy New Year to All!

Sorry to bother your time, but I have tried many times to create two views:

The first view call ‘Valid Entries’

Should select days which are not on week-end, not less than 7 days from submission and shoud be between 9am- 4 pm

My formula was based on 2 fields StartDateN and StartTimeN and the Notify field should be “No” and “Pending”.

temp:= @If(

@Weekday(StartDateN)=1 ;“Sunday”;

@Weekday(StartDateN)=2 ;“Monday”;

@Weekday(StartDateN)=3 ;“Tuesday”;

@Weekday(StartDateN)=4 ;“Wednesday”;

@Weekday(StartDateN)=5 ;“Thursday”;

@Weekday(StartDateN)=6 ;“Friday”;

@Weekday(StartDateN)=7 ;“Saturday”;

“”);

SELECT (( Form= “NTestingAccommodations” : “Request” ) &( Notify =“No”:“Pending”) & !@Contains(temp;“Sat”:“Sun”)

| (Form= “NTestingAccommodations” : “Request”) & (Notify=“No”:“Pending”) & StartDateN > @Adjust(@Created;0;0;7;0;0;0)

| (Form= “NTestingAccommodations” : “Request”) & (Notify=“No”:“Pending”) & @Text(StartTimeN;“T1S1”) <= @Text([04:00:00 PM];“T1S1”) &

@Text(StartTimeN;“T1S1”) >= @Text([09:00:00 AM];“T1S1”))

The second view should do the revese selection.

I believe that my Time comparison is not correct, would you please guide me the right technique to make that works the proper way?

I’m greatly appreciate your time.

Myle

Subject: Using Formula to do time comparison

You shouldnt convert the times to text before comparing. That won’t work for a start.

Just compare dates with dates. e.g

@If(@Time(@Now) > [17:30:00] ; “Time to go home” ;

@Time(@Now) < [09:00:00] “Way to early for me”;

“Aww man its work time”)

Simon

Subject: RE: Using Formula to do time comparison

Dear Simon,

Thank you so much! I was sitting down too long then forgetting a simple basic.

I should not use Or (pipe sign | ) and instead using separate commands continuing with Commas. It works like a charm

Thanks again!

Myle