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)
 Dateformat in SQL Server 2005

Author  Topic 

prasannakumar
Starting Member

6 Posts

Posted - 2008-04-14 : 05:23:21
When I write a query getdate() the aviliable date format is yy-mm-dd
But I need in dd-mm-yy, so how can I get this.
Am getting in all the ways i.e, mm-dd-yy, yy-dd-mm and yy-mm-dd except dd-mm-yy. pl send the ans ASAP.

Thanks in advance

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-14 : 05:26:41
[code]select convert(varchar(8), getdate(), 5)[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-14 : 06:53:41
Or use the FormatDateTime() function available in SQL reporting services
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-14 : 08:41:24
quote:
Originally posted by visakh16

Or use the FormatDateTime() function available in SQL reporting services


That would be better approach

Madhivanan

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

CobraGroup
Starting Member

1 Post

Posted - 2008-04-16 : 04:47:34
Hello. Not really sure where to post this as I don't fully understand where the problem lies.

The problem is that when I type a date into a date field generated by SSRS, the browser returns the date without leading zeros. E.g. 06/04/2008 returns as 6/4/2008 and consequently no data is found. This (at least I thought) was a Regional setting at PC/browser level, because it only happens on certain PCs.

But I've checked Regional Settings and they seem to be the same as the PCs that work. I couldn't find any specific browser settings to look at.

Is there any possible - albeit obscure - way that this can be SSRS related?

Thanks for your time.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-16 : 07:04:50
You do have a reginal setting property for report but if you have same report working in a machine and not in other then that cant be a reason. Is this happening only when report is rendered locally or are you facing this problem even after deploying and running from reporting server?
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-04-16 : 07:12:01
Just explicitly set the date format for the date fields on your report.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -