Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 Time portion is missing

Author  Topic 

hog
Constraint Violating Yak Guru

284 Posts

Posted - 2008-09-08 : 16:55:23
Hi,

When I view a datetime object in vb.net I see the date and time as expected.

But when I save this datetime value to my sql database which has a datetime field only the date appears, the time appears as zeros?

Any pointers?

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-08 : 16:57:39
Are you sure you are using datetime data type in both the database and in the application code instead of varchar(10)?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hog
Constraint Violating Yak Guru

284 Posts

Posted - 2008-09-08 : 17:04:40
Yes, both fields are datetime, however you gave me the clue and buried in my code was a redundant line setting the datetime object to the value of a textbox!

Thanks dude, this has been drivin me crackers all night!!!

Cheers
Go to Top of Page
   

- Advertisement -