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)
 extract only date

Author  Topic 

BCJ
Starting Member

42 Posts

Posted - 2008-07-14 : 16:23:09
Hi , how can i get only the date part from a field which has datatype datetime .i have to display only the date part on the report. (ver- sql server 2005).

thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-14 : 16:25:24
You can use convert function, however you should be doing this inside the report and not inside T-SQL. Just because it can be done inside SQL doesn't mean you should.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

BCJ
Starting Member

42 Posts

Posted - 2008-07-14 : 17:39:32
this date value is a parameter value and this has to attach to field which displays the parameter value. so how it can be attached to the field, could you explain little more
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-14 : 17:40:28
I don't understand what you mean. Keep in mind that we aren't familiar with your environment, so you need to spell things out clearly for us.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

BCJ
Starting Member

42 Posts

Posted - 2008-07-14 : 17:52:04
i mean , where i have to write the code for converting the date value to get only the date part......
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-14 : 17:58:25
If you are using Reporting Services, you can use VB.NET functions. So to get just the date, you could use the Format function.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

BCJ
Starting Member

42 Posts

Posted - 2008-07-15 : 00:01:41
thanks.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-15 : 13:43:02
look for FormatDatetime or even you have a standard dateformat available within the format tab of cell properties.
Go to Top of Page
   

- Advertisement -