• faulknerwilliam2 (7/6/2015)


    Hello

    A date field in a report returns the date value as:

    2015-07-01 13:30:27.000

    Is there any way I can script this to appear as:

    01 July 2015 (or 01-07-2015 or 01/07/2015) - basically to cut out the hours, minutes and seconds?

    The best I have managed is: CONVERT (varchar(17),DATE,113) AS Date1 but this still leaves me with:

    01 July 2015 13:30

    Any expertise in solving this would be very welcome. I can tidy it up in SSRS, but would love to script it instead.

    Thanks.

    You could replace your date in the report with an expression which formats the data to th desired format, for example: =Format(Fields!Date.Value, "d/M/yyyy")

    This would format the date as 1/7/2015.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]