Sunday, February 19, 2012

About removal of TimeStamp from DateTime part in TSQL.

Hi friends,
Does anybody could say how to remove the TimeStamp from DateTime part
in TSQL.
Thanks&Regards
Sunil.
Sunil a crit :
> Hi friends,
> Does anybody could say how to remove the TimeStamp from DateTime part
> in TSQL.
> Thanks&Regards
> Sunil.
>
Example, actual date without time :
SELECT CAST(FLOOR(CAST(CURRENT_TIMESTAMP AS FLOAT)) AS DATETIME) AS
"CURRENT_DATE"
CURRENT_DATE
2006-02-15 00:00:00.000
A +
Frdric BROUARD, MVP SQL Server, expert bases de donnes et langage SQL
Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
Audit, conseil, expertise, formation, modlisation, tuning, optimisation
********************* http://www.datasapiens.com ***********************
|||Removing is not possible if you use a timestamp, though you can set it
to 00:00:00, but eleminating is NOT possible. Time is always stuck to
date and vice versa. If you want the two things separated, you have to
use a CHARACTER Storage like VARCHAR, then you can CONVERT the datetime
to any non-containing time-format.
HTH, jens Suessmeyer.
|||Hi
The time part of a datetime will always be stored in the database, even if
you do not specify it when you insert the date it will default the time to
00:00:00. For display purposes you can use the CONVERT function to display
only the date portion of the datetime in a string format. See Books Online
for more information.
John
"Sunil" wrote:

> Hi friends,
> Does anybody could say how to remove the TimeStamp from DateTime part
> in TSQL.
> Thanks&Regards
> Sunil.
>

No comments:

Post a Comment