DefinitionExpression without or

3615
5
Jump to solution
06-03-2015 08:46 AM
RickeyFight
MVP Regular Contributor

I am using JavaScript.

I am looking for a way to write:

Time  >= '21:00'AND Time <= '23:59:59' OR Time >= '00:00:01' AND Time <= '02:00'

Without an OR statement.

What I really need is time (9pm-2am).

0 Kudos
1 Solution

Accepted Solutions
RickeyFight
MVP Regular Contributor

I thought of another way that does work:

NOT Time BETWEEN '03:00:00' AND '21:00'

Thank you both for your input.

View solution in original post

5 Replies
ChrisSmith7
Frequent Contributor

Rickey, I haven't tried this; however, I believe you may be able to use the BETWEEN operator:

Time  between '21:00:00' and '02:00:00'

Try that and see if it works.

thejuskambi
Occasional Contributor III

Doesn't Time  >= '21:00' AND Time <= '02:00' this work. since its a 24 hour time.

ChrisSmith7
Frequent Contributor

That should work, too. Many ways to skin a cat!

0 Kudos
RickeyFight
MVP Regular Contributor

thejus and Chris,

Neither of these returns results. I am using this in a definitionexpression.

They both work for times that are within 24 hrs. Such as 6am-8pm

The OR statement works but for some reason that messes up the rest of the definitionexpression

0 Kudos
RickeyFight
MVP Regular Contributor

I thought of another way that does work:

NOT Time BETWEEN '03:00:00' AND '21:00'

Thank you both for your input.