Is the column defined as datetime or smalldatetime? If so, you can simply select the column in a query. If you run the query in SQL Query Anlayzer, the dates will display in the default date/time format. If you run a query in Access, Access will display the result in it's date/time format. If you run the query in another client software, you'll need to determine how the software displays dates.
SQL Server allows conversion of dates to different character formats using the Convert function. For example, if I want to guarantee that a date will be returned in yyyy/mm/dd format, I would use the following select statement.
Select convert (char(10), datecolumn, 111) As NewDate
From table1
datecolumn is the column name in table1. 111 is the date style which corresponds to yyyy/mm/dd format. NewDate is the name of the derived column. You can actually name the column the same name as on the table. Specify "As datecolumn" rather than "As NewDate."
See the topic, "CAST and CONVERT (T-SQL)" in SQL Books Online for more information about converting dates including the available styles. Terry
X-) "I don't have a solution, but I admire your problem."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.