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
Posted Monday, August 6, 2012 11:23 PM


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: Monday, August 10, 2015 12:07 AM
Points: 885, Visits: 261
Please check this...

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

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



Group: General Forum Members
Last Login: Today @ 7:32 AM
Points: 5,864, Visits: 5,846
Use the dd-MMM-yyyy format string instead.

Check this link out for other format strings

Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
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