Naomi,
for reporting purposes (the qualification I presented), you can use the integer that datepart returns for the year, the integer that it returns for the month, and the integer it returns for the day of month, to display the date using the datetime function. Of course, not much is gained, as you will end up with the datetime equivalent of a date value (the stroke of midnight), and still have to convert it for display purposes.
Now, what we do in our SQL apps is use a control that displays date, and allows smart editing of that date, whether the underlying data is date, datetime, or character. The control on access returns the changed date + the original time.
Compared to either approach, both of which have pitfalls, using SQL2008 is much preferable.
Another case in which supporting the past is expensive to the developer.
Hank
>>Hi Yew,
>>
>>in addition to James' suggestion of using datepart in the query, SQL2008 does in fact have a date column type:
http://www.sqlteam.com/article/using-the-date-data-type-in-sql-server-2008. Since you are using SPT, you are probably not updating the cursor (by setting the cursor properties to support buffering, etc.), so datepart ought to work for you.
>>
>>hth,
>>
>>Hank
>>
>Hank,
>
>How are you suggesting to use datepart in this query?