Substracting 3 time attributes

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
robleer
Posts: 285
Joined: Wed Jul 14, 2010 7:01 pm

Substracting 3 time attributes

Post by robleer »

Hi,

I have 3 attributes of type "Timestamp" (StartTime, EndTime, PauzeTime)


To calculate the total time I do this:

Work.TotalTIme=Work.EndTime-Work.Starttime /// This works with two times to substract

Work.TotalTIme=Work.EndTime-Work.Starttime-Work.PauzeTime ///This does NOT work. The error is:


com.bas.shared.ruleparser.ParseException Operands in expression Work.Endtime-Work.Starttime-Work.PauzeTime are of incompatible types.

But the attributes are exactly the same (I've checked this). All combinations do work as long as I substract only 2 of these attributes.
When I use 3, I get this error.

Is there a way to substract 3 time attributes???
Using 8.7 Professional 3025 on MySQL/Windows
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: Substracting 3 time attributes

Post by BobK »

I am just guessing, but here is what I think is causing your error.

Subtracting a TimeStamp from a TimeStamp (Work.EndTime - Work.Starttime) gives you a Duration. Subtracting your third TimeStamp (Work.PauzeTime) from the Duration gives you your error.

What does PauzeTime represent? A point in time (TimeStamp) the work was paused or the length of time (Duration) that the work was paused.

What attribute type is Work.TotalTime? Looks to me it should be a Duration.
Bob
robleer
Posts: 285
Joined: Wed Jul 14, 2010 7:01 pm

Re: Substracting 3 time attributes

Post by robleer »

You are right. I changed it to Duration attributes and changed the processes and now it works fine! Tnx!
Using 8.7 Professional 3025 on MySQL/Windows
Post Reply