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.
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 KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
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 |
 |
|
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 KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
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...... |
 |
|
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 KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
BCJ
Starting Member
42 Posts |
Posted - 2008-07-15 : 00:01:41
|
thanks. |
 |
|
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. |
 |
|
|
|
|