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)
 convert numeric to time

Author  Topic 

basmala
Starting Member

2 Posts

Posted - 2008-11-08 : 16:42:34
It will be kind of you to help me
I have a field in the database (numeric)
and i want in the report server to convert this numeric value to a time format (HH:mm)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-09 : 01:28:27
you need to specify how values in numeric field exists and what time does that represent? for example if value is 14.5 does that represent 14:50 or 14:30
if former, then use
CONVERT(datetime,REPLACE(numericfield,'.',':'),108)


if latter, then
DATEADD(n,SUBSTRING(numericvalue,CHARINDEX('.',numericvalue)+1,2)*0.6,DATEADD(hh,ROUND(numericvalue,0),0))

Go to Top of Page
   

- Advertisement -