February 16, 2009 at 1:04 pm
If the field is truly a timespan type then this code:
=Fields!StartTime.Value.ToString() & " to " & Fields!EndTime.Value.ToString()
should work as the TimeSpan type in .NET has a ToString Method.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 16, 2009 at 1:08 pm
Oh, my god, Jack, you're a genius. It works! Thanks so so so much!! Now just one last thing and I swear I'll leave you alone forever: Do you know how to display that as 12-hour time instead of military?
February 16, 2009 at 1:59 pm
I don't think you can do it without using some custom code in the report. Here is the custom code you would need and the expression:
Function TimeSpanToString(ts as TimeSpan) as String
Dim DT as new DateTime(TS.Ticks)
Return DT.ToString("T")
End Function
=Code.TimeSpanToString(Fields!StartTime.Value) & " to " &
Code.TimeSpanToString(Fields!EndTime)
You can look at this link to see how the different format types work based on your culture info settings
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 16, 2009 at 2:08 pm
Jack, thank you so much. That worked perfectly. You and Gift are both lifesavers--if I could give you a virtual hug, I would. :Wow:
Thank you thank you thank you!
February 16, 2009 at 2:14 pm
Hey it is Jack that helped, my Expression skills is limited.
🙂
Kind regards,
Gift Peddie
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply