Displaying Time in Reporting Services 2008

I have a table in my report where I have data type columns Time(7).

Now I have problems formatting them in Reporting Services 2008.

If I set the expression format to HH: mm, it still displays 11:12:000!

I want to get only hours and minutes! eg11:12

It looks like RS does not know the format. None of the following work:

=Hour(Fields!MyTime.Value)

=CDate(Fields!MyTime.Value)

Both give an error. I think it is possible, formats it like plain text?

thanks for the help

Edit:

I am using SQL Server 2008 R2 Express as a database. (therefore, I include the DataSource in the report because Reporting Services in SQL Server Express does not allow the use of shared data sources.)

Solution (thanks Mark Bannister):

=Today() + Fields!MyTime.Value

, datetime!

+3
2

MyTime cast(MyTime as datetime) as MyTime HH:mm.

+3

FORMAT(). :

datagrid/matrix . :

format( (time1 -time2) + (time3 - time4) , "HH:mm")  

Datetime, "" .

format(dateVal,"MM/dd/yyyy") 

10/05/2010

, :

http://msdn.microsoft.com/en-us/library/59bz1f0h(v=VS.90).aspx

+1

Source: https://habr.com/ru/post/1767671/


All Articles