Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Subtracting time im AM/PM format

Author  Topic 

jhaney
Starting Member

33 Posts

Posted - 2010-12-06 : 15:21:59
I have start time and and end time that is stored in my DB in am pm format. Ex. start time 8:45 am and end time 9:00 am. My issue is i need to subtract the 2 and showing the 15 minutes. when I try to suptract the 2 values like this

=(Fields!START.Value)-(Fields!END.Value) i get the following error
The Value expression for the textbox ‘textbox10’ references a field outside an aggregate function. Value expressions in matrix cells should be aggregates, to allow for subtotaling.

My guess is I need to convert the time to 24 hour fomat?

Any ideas in this?

Thanks

Joshua


dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2010-12-06 : 18:27:36
use the datadiff function somehow? datediff(mi,Fields!START.value,Fields!END.Value)

Datediff would be better...




Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

jhaney
Starting Member

33 Posts

Posted - 2010-12-07 : 09:14:45
Thanks for the idea, I ended up using the following expression

=cdate(Fields!READY.Value) - cdate(Fields!ARRIVED.Value)
Go to Top of Page
   

- Advertisement -