Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Seconds missing when insert datetime

Status
Not open for further replies.

christer99

IS-IT--Management
Dec 3, 2001
247
When I insert this value 5/22/2007 2:28:04 into a datetime field, the seconds are "missing". Instead of 2:28:04, I end up with 2:28:00 being recorded to the SQL table. Any ideas?
 
Are you sure it's a DateTime column. There is also a SmallDateTime that has a resolution to the minute.

Code:
Declare @Temp SmallDateTime
Set @Temp = GetDate()

Select @Temp, GetDate()

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Note also that SmallDateTime will Round Up. Any Datetime more than 30 seconds past a given minute rounds up to the next minute.
 
I am inserting the value from an ASP page, so I guess it is an ASP question. The field is datetime and not smalltime. It works in SQL, but not when I insert from an ASP page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top