How do I format date and time on ssrs report?

前端 未结 12 2030
野的像风
野的像风 2020-12-02 18:03

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

相关标签:
12条回答
  • 2020-12-02 18:29
    =Replace(Format(CDate(Now()),"MM.dd.yyyy"), ".", "/")
    
    0 讨论(0)
  • 2020-12-02 18:30

    In SSRS 2016 There is an option under the properties header "Localization" called "Calendar", if you click on this it gives you these 2 options:

    • Gregorian (dd/mm/yyyy)
    • GregorianUSEnglish (MM/dd/yyyy)

    This works brilliantly when referencing data from a tables aswell

    alternatively if this does not work for you, specify one of these formats under "Number" and in the cell "Format":

    dd/MM/yyyy or MM/dd/yyyy

    0 讨论(0)
  • If you click on the empty spot on the report away from any table and then look in properties, one of the Misc fields is called Language which allows you to pick which Language you would like to set, which after doing so can play around with this

    =FormatDateTime(now,x)
    

    Which x can be 1, 2, 3, 4, 5

    0 讨论(0)
  • 2020-12-02 18:35
    =Format(Now(), "MM/dd/yyyy hh:mm tt")
    

    Output:

    04/12/2013 05:09 PM
    
    0 讨论(0)
  • 2020-12-02 18:35

    The following is how I do it using Visual Studio 2017 for an RDL targetted for SSRS 2017:

    Right-click on the field in the textbox on the design surface and choose Placeholder Properties. Choose the Number panel and click on Date in the Category listbox, then select the formatting you are looking for in the Type listbox.

    0 讨论(0)
  • 2020-12-02 18:37

    Hope this helps:

    SELECT convert(varchar, getdate(), 100) -- mon dd yyyy hh:mmAM
    
    SELECT convert(varchar, getdate(), 101) -- mm/dd/yyyy – 10/02/2008                  
    
    SELECT convert(varchar, getdate(), 102) -- yyyy.mm.dd – 2008.10.02           
    
    SELECT convert(varchar, getdate(), 103) -- dd/mm/yyyy
    
    SELECT convert(varchar, getdate(), 104) -- dd.mm.yyyy
    
    SELECT convert(varchar, getdate(), 105) -- dd-mm-yyyy
    
    SELECT convert(varchar, getdate(), 106) -- dd mon yyyy
    
    SELECT convert(varchar, getdate(), 107) -- mon dd, yyyy
    
    SELECT convert(varchar, getdate(), 108) -- hh:mm:ss
    
    SELECT convert(varchar, getdate(), 109) -- mon dd yyyy hh:mm:ss:mmmAM (or PM)
    
    SELECT convert(varchar, getdate(), 110) -- mm-dd-yyyy
    
    SELECT convert(varchar, getdate(), 111) -- yyyy/mm/dd
    
    SELECT convert(varchar, getdate(), 112) -- yyyymmdd
    
    SELECT convert(varchar, getdate(), 113) -- dd mon yyyy hh:mm:ss:mmm
    
    SELECT convert(varchar, getdate(), 114) -- hh:mm:ss:mmm(24h)
    
    SELECT convert(varchar, getdate(), 120) -- yyyy-mm-dd hh:mm:ss(24h)
    
    SELECT convert(varchar, getdate(), 121) -- yyyy-mm-dd hh:mm:ss.mmm
    
    SELECT convert(varchar, getdate(), 126) -- yyyy-mm-ddThh:mm:ss.mmm
    
    0 讨论(0)
提交回复
热议问题