Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I am trying to create a new field with three values based on time periods during a day.
I'm using the following script in the load script:
If([Begintijd] >=7 and [Eindtijd] <= 18, Dual('Overdag', 1),
If([Begintijd] >18 and [Eindtijd] < 23, Dual('Avond',2),
If([Begintijd] >=23 and [Begintijd] <0 and [Eindtijd] >=0 and [Eindtijd] < 7, Dual('Nacht',3))))
AS [Transport Dagperiode]
The field [Begintijd] and [Eindtijd] are formatted as followed: 8AM for example is formatted as 8,00 and 8PM is formatted as 20,00. The full lenght of the values for both fields lies between 0,00 and 23,59
The values 'Overdag' and 'Avond' work correctly but i can't figure out what is wrong with expression of the 'Nacht' value
The result I am trying to get is:
When [begintijd] >= 23,00 (11PM) and <7,00 (7AM) and [Eindtijd] >= 23,00 (11PM) and <7,00 (7AM) = 'Nacht'
Is there anyone who can help me with this? 🙂
Many Thanks in advance!
Sincerley,
Rick
May be try this
If( ([Begintijd] >= 23 or [Begintijd] < 0) and ([Eindtijd] >= 0 or [Eindtijd] < 7)
May be try this
If( ([Begintijd] >= 23 or [Begintijd] < 0) and ([Eindtijd] >= 0 or [Eindtijd] < 7)
Thank you very much!
The or operator works like a charm 🙂
Have a great day!