2
Shouts

Easy way to strip time part in sql date time

posted by kcherupakcherupa 890 days, 1 hour, 16 minutes ago
Tuesday, December 15, 2009 5:21:56 AM GMT

Most of the times we wouldn't want the time part of the dates to be stored or retrieved when dealing with only days. But the data type "datetime" in sql always includes the time even though you don't want it. There is no other data type in sql to store or retrieve the date without time. In this case we need to strip the time part from the date and store the remaining in database. To do this favor, I have come up with the below sql code which strips the time part from the date time.

declare @date datet...

category: SQL | clicked: 0 | | source: cherupally.blogspot.com | show counter code
tags: time part, DateTime, SQL, strip

No comments yet, be the first one to post comment.

To post your comment please login or signup