Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have excel as source data. We have a field called Start Time. Format is like below:
Now I need to create a new field called SupportZone. The condition would be like below:
if time in between 10:00:00 and 22:00:01, then US support else India Support.
My script like below:
if(Date([Start Time],'hh:mm:ss') >= '10:00:00' or Date([Start Time],'hh:mm:ss') < '22:00:01', 'US Support', | |
'India Support') as SupportZone, |
It is not working properly. All records are coming under US Support.
Could any one please guide me.
Thanks,
Sarif
Try this
If(Frac([Start Time]) >= MakeTime(10) and Frac([Start Time]) < MakeTime(22, 0, 1), 'US Support', 'India Support') as SupportZone
Try this
If(Frac([Start Time]) >= MakeTime(10) and Frac([Start Time]) < MakeTime(22, 0, 1), 'US Support', 'India Support') as SupportZone
Looks like it is working. But I am bit curious how Frac is working on Date. I thought it works only in Number.
Can you please help me to understand.
If you have a good doc on this. Please share.
Thanks,
Sarif
Date is dual field... which looks like a date, but has an underlying numeric value to it... when you were using Date() function to display hh:mm:ss... it was just DISPLAYING hh:mm:ss. Underlying value was still a date and time. Using Frac, we removed the date part and converted the date time to just time.
Does it make sense?