Date format

  • Is this format for date expression correct? (i mean syntax)

    I must get in dd-mm-yyyy format

    CDate(Fields!Trn__Date.Value).ToString("dd-mm-yyyy")

  • I have Trn_Date like Jan-09-2010 09:13:00 AM

    I have to represent this in dd/mm/yyyy format. what is the expression i must use?

  • Hi,

    Try this, there can be other method also.

    =Day(Fields!dt.Value)& "-" & Month(Fields!dt.Value)&"-"&Year(Fields!dt.Value)

    Thanks & Regards,
    MC

  • Hi Malvika,

    As a better practice it is always suggested that one should always handle date-time manipulation at database level and not on SSRS interface.

    Raunak J

  • Hi

    Try this One

    Format(Cdate(Fields!dt.Value),”dd-MM-yyyy”)

  • Hi All,

    Thanks for your reply.

    Now i have made the conv in my SP itself as Raunak has suggested.

    But earlier i have used cdate many times without any prob, but this time i got error so asked.

    Thanks for all your valuable suggestions.

  • Hi Malavika,

    It seems your issue is resolved.

    You must understand that Type conversions though seems easy add a lot of overload to underlying engine...considering that you have a large database to play with.

    It is always desired to get the best, up to mark data on SSRS for publishing purposes.

    By the way you practice or are you a professional.;-);-);-)

    Raunak J

  • Raunak Jhawar (5/6/2010)


    Hi Malvika,

    As a better practice it is always suggested that one should always handle date-time manipulation at database level and not on SSRS interface.

    Heh... not "always suggested" because I usually suggest that SSRS handle all formatting so SQL Server doesn't have to. In fact, it's usually suggested that no formatting be done by SQL Server and that whatever appliction you're using do the formatting. SSRS is just another application.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply