SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


format date within reporting services


format date within reporting services

Author
Message
dva2007
dva2007
Right there with Babe
Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)

Group: General Forum Members
Points: 780 Visits: 1112
= right(("0" + Cstr(Day(Fields!admdate.Value))),2) + "/" + right(("0" + Cstr(Month(Fields!admdate.Value))),2) + "/" + Cstr(Year(Fields!admdate.Value))

assume your date field name - admdate
rene-500237
rene-500237
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2657 Visits: 1186
Hi,
I could set my format string in the property 'Format' like dd.MM.yyyy and get the correct German date format.
Rgds
apjchandresh
apjchandresh
SSC Rookie
SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)

Group: General Forum Members
Points: 31 Visits: 22
Hi ,

you can Used this
=Format(Fields!myDate.Value, “MM/dd/yyyy”)
Brandie Tarvin
Brandie Tarvin
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14564 Visits: 8990
Apjchandresh, you're misunderstanding what they're asking for. The format is already MMDDYYYY. They're trying to reverse the day & the month so Day is listed first.

Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
ryan121
ryan121
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 102
has anyone made a 'cheat sheet' for formatting in SSRS? It would be very helpful as I find myself constantly googling date/time formats...

Something like: http://msdn.microsoft.com/en-us/library/73ctwf33.aspx

=Format(Fields!startdate.Value, "dd/mm/yy")

But refer to url for exact formatting

Cheers,
Ryan
nigel.
nigel.
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1827 Visits: 2858
ryan121 (9/22/2009)
has anyone made a 'cheat sheet' for formatting in SSRS? ...


Like this perhaps?: http://john-sheehan.com/blog/wp-content/uploads/msnet-formatting-strings.pdf

--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden

Van Heghe Eddy
Van Heghe Eddy
SSC Eights!
SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)

Group: General Forum Members
Points: 871 Visits: 900
Ryan,
Would not work,
cause "mm" stands for minutes, not Months

if you have the need for the day first :
go to the filed expression
type : =format(fields!fieldname.value,"dd/MM/yyyy") , gives 19/11/2009
=format(fields!fieldname.value,"MM/dd/YYYY"), gives 11/19/2009
=format(fields!fieldname.value,"yyyy/dd/MM"), gives 2009/19/11
you can also change the / by - or : of whatever separator you want to use

Hopes this helps you a bit.
Wkr,
Eddy
battula.praveen
battula.praveen
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 14
Try this one. May helps.
http://praveenbattula.blogspot.com/2010/01/date-formatting-in-sql-server-reporting.html
dssingh17-819020
dssingh17-819020
SSC Rookie
SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

Group: General Forum Members
Points: 39 Visits: 220
Use =FormatDateTime(Data Field Name,2) or =Format(Data Field Name,"mm/DD/yyyy").
Van Heghe Eddy
Van Heghe Eddy
SSC Eights!
SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)SSC Eights! (871 reputation)

Group: General Forum Members
Points: 871 Visits: 900
dssingh17-819020 (2/3/2010)
Use =FormatDateTime(Data Field Name,2) or =Format(Data Field Name,"mm/DD/yyyy").


No, impossible, cause lowercase 'mm' will give you minutes in stead of months
its just the mm that would have to be in uppercase and the dd have to be in lowercase

=format(datetimefield.value,"MM/dd/yyyy") = 11/20/2010
or in european format
=format(datetimefield.value,"dd/MM/yyyy") = 20/11/2010

wkr,
Eddy
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search