Forum Discussion
MarkShnier__You
Qrew Legend
5 years agotry this
var datetime MidnightOfClockInDay = ToTimestamp(ToDate([Clock In Date Time]), ToTimeOfDay("12:00 am"));
var duration RoundedDuratonfromMidnight = Round([Clock In Date Time] - $MidnightOfClockInDay, Minutes(15));
ToTimeOfDay("12:00 am") + $RoundedDuratonfromMidnight
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
var datetime MidnightOfClockInDay = ToTimestamp(ToDate([Clock In Date Time]), ToTimeOfDay("12:00 am"));
var duration RoundedDuratonfromMidnight = Round([Clock In Date Time] - $MidnightOfClockInDay, Minutes(15));
ToTimeOfDay("12:00 am") + $RoundedDuratonfromMidnight
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- WallaceYeboah5 years agoQrew MemberThanks for the response Mark! I'm still getting this error for the last line of code:
"Expecting duration but found timeofday"
------------------------------
Wallace Yeboah
------------------------------ - WallaceYeboah5 years agoQrew MemberActually disregard that last message. Its working now. Thanks a lot!
------------------------------
Wallace Yeboah
------------------------------- CourtneahThomas5 years agoQrew TraineeWallace Yeboah, how did you get it to work? I am getting an error message on the last line that says "expecting text but found time of day"
------------------------------
Courtneah Thomas
------------------------------- KevinHaigler5 years agoQrew MemberHi Courtneah,
the ToTimeOfDay function will convert the return to a time of day data type, if your formula is expecting text, then your field type is formula-text. You can either update this to Date/Time, or use one of the other conversion functions (ToText). Though I'm not sure what kind of display you'll get converting this to text.
I'd recommend changing your field type to Date/Time or Duration depending on your use case.
------------------------------
Kevin Haigler
------------------------------