on SSRS report I need to show todays date and current time
i tried this =FormatDateTime(Now,\"MM/dd/yyyy hh:mm tt\")
but this is not worki
If the date and time is in its own cell (aka textbox), then you should look at applying the format to the entire textbox. This will create cleaner exports to other formats; in particular, the value will export as a datetime value to Excel instead of a string.
Use the properties pane or dialog to set the format for the textbox to "MM/dd/yyyy hh:mm tt"
I would only use Ian's answer if the datetime is being concatenated with another string.
hi friend please try this expression your report
="Page " + Globals!PageNumber.ToString() + " of " + Globals!OverallTotalPages.ToString() + vbcrlf + "Generated: " + Globals!ExecutionTime.ToString()
I am using following in SSRS 2005
=Format(Globals!ExecutionTime,"MM-dd-yyyy" & " ")
& CStr(Hour(Globals!ExecutionTime)) & ":"
& CStr(Minute(Globals!ExecutionTime))
Or
=Format(Globals!ExecutionTime,"MM-dd-yyyy" & " ")
& Right("00" & CStr(Hour(Globals!ExecutionTime)), 2)
& ":"
& Right("00" & CStr(Minute(Globals!ExecutionTime)), 2)
Based on comment:
=Format(CDate(Globals!ExecutionTime), "MM-dd-yyyy hh:mm.ss")
OR
=Format(CDate(Globals!ExecutionTime), "MM-dd-yyyy HH:mm.ss")
First go to your control panel , select Date , time and Number Format . Now select English(United Kingdom) from the drop down list.
Make sure the shor date field is equal to 'dd/mm/yyyy'. Press Apply. Now go to SSRS and right click on the report in the empty space and select properties.
If you are using visual studio then set Language property equal to =User!Language.
If you are using Report Builder then Language property will appear in Localization section.
I am using this
=Format(Now(), "dd/MM/yyyy hh:mm tt")
If you want date and time separate then use below expressions: Date and Time Expression
Expression1 for current date : =formatdatetime(today) its return date is = 11/15/2016
Expression2 for current time : =CDate(Now).ToString("hh:mm tt") its return time is = 3:44 PM
This report printed on Expression1 at Expression2
Output will be : Output of Both Expression
This report printed on 11/15/2016 at 3:44 PM