Using SQL 2005
methode 1:
CAST((
STR( YEAR( GETDATE() ) ) + '/' +
STR( MONTH( GETDATE() ) ) + '/' +
STR( DAY( GETDATE() ) ))
AS DATETIME)
methode 2(I think the beter one):
CAST(
FLOOR( CAST( GETDATE() AS FLOAT ) )
AS DATETIME)
No comments:
Post a Comment