still very new to reports and all, currently trying to modify the time format for a report and I'd like it to appear as (ex.) 02:30:05 PM rather than the current/default 14:30:05.
Here's what I have so far:
="between the hours of " & Format(Parameters!StartTime.Value, "hh:mm:ss tt") & " and " & Format(Parameters!EndTime.Value, "hh:mm:ss tt") & " (" & Parameters!TimeZone.Label & ")"
The problem is that running the report it comes up as "between the hours of hh:mm:ss tt and hh:mm:ss tt" instead of "between the hours of 02:30:05 PM and 03:30:05 PM".
Any ideas as to why that might be? Thank you!
It appears that the data type for your parameter is causing this. You most likely currently have it set to Text
. In the Parameter Properties, change it to Date/Time
. This will allow the Format
function to interpret it as a date and time instead of a string.
Alternatively, you can cast the parameter value as a date in the expression like this:
Format(CDate(Parameters!StartTime.Value), "hh:mm:ss tt")