10 replies
by burlynerd
In SQL Server, we use CONVERT to trim down to the date. CAST should also work fine.
Assuming that MYDATE is a datetime, try this:
CONVERT(DATETIME,CONVERT(CHAR(11), MYDATE))
Regards,
BN
by tcolon1
by shyl
If you've already imported the date time data into the target db to a table and just want to view that data with the time part suppressed you can try the following query in SQL Server
SELECT CONVERT (date_time, ColumnName, 101) AS NewColName fromTableName
Where
ColumnName - Name of the datetime column in question
TableName - Name of the table which holds that field
NewColName - some title to display when showing the query result.
Specifying the style as 101 would display the datefield in mm/dd/yyyy format, the style number can be changed based upon your requirement.
If you want to do in MS Access you can use the FORMAT statement with either Short Date or Medium Date setting specified.
by tcolon1
by donq
by jbutcher
by tcolon1
by tcolon1
This discussion is closed to new replies.
Trending Software posts
Sort by Trending