Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Date Format

Author  Topic 

ashishkukreja
Starting Member

16 Posts

Posted - 2007-09-24 : 01:50:03
I am creating a report in Business Intelligence Studio

there I am getting a problem is that, I have a one date column in format mm/dd/yyyy hh:mm, in my SQL Server Table
I want to show it in my report in different format which is dd/mm/yyyy.
What I have to do for this

Ashish Kukreja


You Have to Loss Many Times to Win Single Time

Kristen
Test

22859 Posts

Posted - 2007-09-24 : 02:00:46
"I have a one date column in format mm/dd/yyyy hh:mm, in my SQL Server Table"

If its stored in a DATETIME datatype column then it doesn't have a format, its a native date + time object, and you can format it however you like.

If it isn't stored in a DATETIME column then it should be! but you will have to convert it to datetime, and then format it appropriately

As you;ve posted this in the Reporting Services forum I presume you are using that for your output, so within that there are formatting functions [which I'm not familiar with, sorry].

See also: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Date%20formatting,Format%20Date

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-09-24 : 02:47:42
Is there not a format function?

Format("Col","dd/mm/yyyy")

provided you can use VB date functions
http://msdn2.microsoft.com/en-us/library/ms157328.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

angela2137
Starting Member

2 Posts

Posted - 2007-09-27 : 14:47:55
Select the field you want formatted, properites, format tab and select the elicpse ..., select the format you want. Hope this is what you were looking for.
Go to Top of Page

jdGONEMAD
Starting Member

2 Posts

Posted - 2007-09-27 : 20:02:57
try this in the expression:

=FormatDateTime(Fields!birthday.value, 2)

change 2 for the format. try 1-5 (not sure how many formats are there)
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2007-10-09 : 09:45:21
hi, when I try this I get errors on dates if dd > 12.
I think this is because my date field displays records like dd/mm/yyyy . is the above only available to use with american dates ?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-09 : 09:47:49
Sounds like its thinking your data's Day is its Month and vice versa.

That won't happen if the original is in a DATETIME datatype.

What datatype is the data you coming FROM ?

Kristen
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2007-10-09 : 10:02:34
hi Kristen,
looks like my dates are displayed as US in the table.
is it possible to convert them from us to uk as datetime then format ?
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2007-10-09 : 10:04:17
actually, fro mthe data tab, If I execute the query the data is displayed correctly ! ie, dd/mm/yyyy 00:00:00 .
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2007-10-09 : 10:06:21
ignore this, I'm being an idiot ! thursday , may 03, 2007 is 03/05/2007 !
Is there a way of changing that around so it says thursday 03 May 2007 ?!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-09 : 10:20:14
CONVERT(varchar(24), SomeDateColumn, 113) or maybe 103, I forget, but its in Books Online under CONVERT.

There isn't a format that will give you the Day Name in one-strike IIRC

You should format in the front end application, rather than having SQL Server convert a nice date/time datatype into a text string ...

Kristen
Go to Top of Page
   

- Advertisement -