Re: Convert Hours to Decimal
| From: | Richard Quadling | Date: | Thu, 27 Oct 2011 11:45:47 +0000 |
| Subject: | Re: Convert Hours to Decimal | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-315447@lists.php.net to get a copy of this message | ||
On 17 October 2011 22:57, Don Wieland <donw@dwdataconcepts.com> wrote:
> select timediff(cast(out_1 as time), cast(in_1 as time)) tHours FROM
> lm_tc_trans WHERE tc_trans_id = '42'
Can you try ...
SELECT
CAST
(
TIMEDIFF
(
CAST(Out_1 AS Time),
CAST(In_1 AS Time)
)
AS Decimal(5,2)
) tHours
FROM
lm_tc_trans
WHERE
tc_trans_id = '42'
Basically, CAST the result back to a decimal(5,2)
--
Richard Quadling
Twitter : EE : Zend : PHPDoc : Fantasy Shopper
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
fan.sh/6/370