RDLC Get time from Date/Time value stored as text

One of my recent requirements involved retrieving just the time portion of a records value,  generally the best practise for this is to have the data type saved as a date/time format (for me using SQL smalldatetime) then the later part of this post is relevant.

Anyway, as the data was being stored as a text value the way to manipulate this on a report is as follows:

On your report create a new table and point it to your relevant dataset.

Remove 2 columns and the header row as below (If you are using an existing table ignore this line)

Select the field from the list.

Then right-click the cell, select expression and enter the following:

This converts the text to date format

Click OK. then right-click the cell, select Textbox properties, then Number and the Time category.

Select the prefered format and click OK.

~ by markosdotnetblurb on May 22, 2012.

Leave a comment