Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to display date in format of dd-MON-yyyy? Expand / Collapse
Author
Message
Posted Monday, August 6, 2012 11:23 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, April 4, 2013 1:08 AM
Points: 10, Visits: 33
I have textbox for Date which displays Subscription_date field of dataset1 in format dd-mm-yyyy. Now i want this format to be done in dd-MON-yyy where MON is like JAN, FEB etc. And expression for date fields right now is
=First(Fields!SUBSCRIPTION_DATE.Value, "DataSet1")
However, specifying this as
=Format(Fields!SUBSCRIPTION_DATE.Value, "dd-MON-yyyy") throws an error like expreesion can refer to field within current dataset aggregate.
So how to write an expression with date format and dataset as well.
Post #1341007
Posted Monday, August 6, 2012 11:26 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, August 14, 2014 6:01 AM
Points: 885, Visits: 259
Please check this...

SELECT CONVERT(VARCHAR(11), subscription_date, 106) AS [DD MON YYYY]


Thanks
Post #1341008
Posted Tuesday, August 7, 2012 2:56 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
Use the dd-MMM-yyyy format string instead.

Check this link out for other format strings

http://msdn.microsoft.com/en-us/library/8kb3ddd4%28VS.71%29.aspx




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1341078
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse