Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello
first of all i want to say that this web site has helped me alot and i take the chance to thank all the ones who helped me in my past question hope in the future i can be one who helps sm1 else as you did with me

anw i have a little problem i have a databse field where i save date from a calender in vb.net but when i click the save button the date is save but with a time stamp wich is always = to 12:00:00 AM is the any way to save only the date ?

the datafield is of type datetime plz if anyone can help me i apreciate that

hank you in advanced

[edit]Spurious bold removed - OriginalGriff[/edit]
Posted
Updated 24-Apr-12 22:47pm
v2

1 solution

An SQL DateTime field will always have a time component - that is what it stores: A date, with a Time (hence the name).
If you need to store it without a time (even a default time such as 00:00 or 12AM) then you need to use a Date field instead.

Personally? I wouldn't bother - I'd go with the DateTime as it allows for future expansion.
 
Share this answer
 
Comments
kroz18 25-Apr-12 5:06am    
the problem lies when i'm retreiving the data into a view page if the time is changed for anyreason in the view page the calender wich point to the date of upload will not be functional thats why i was trying to change it
thank you i apreciate your help :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900