yewmeng Posted February 19, 2004 Posted February 19, 2004 hi all i got some problem 2 save my date value to the database im usinng this command in vb .net dim todayDate as DateTime = DateTime.Today i assigned todayDate to a textBox and i can see the date of today. but after i save it to the database the value become 20/02/2004 0:00:00 y this happen? pls help me i am stuck!!! thx in advance. Quote
bungpeng Posted February 20, 2004 Posted February 20, 2004 SQL Server store date in datetime format, so you just need to format it to whatever format you want, example: txt.Text = Format(DBDate, "dd/MM/yyyy") Quote
TechnoTone Posted February 20, 2004 Posted February 20, 2004 I find it's always best to format dates with a non-numerical month. That way, there is never any ambiguity regarding which part is the day and which is the month. dd-MMM-yyyy is my preferred date format. Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
bungpeng Posted February 20, 2004 Posted February 20, 2004 I do agree with you if it is read-only date Quote
yewmeng Posted February 20, 2004 Author Posted February 20, 2004 is working good now i have another problem lets say i have a column Date in my table and 3 rows of record for example 22/01/2003, 24/02/2003/, 31/01/2002 im using sql statement "select max (Date) from table" to show the latest late. The date return by this statement is suppose to be 24/02/2003 rite? but the result is 31/01/2002 after i key in some different date, i found that the sql statement will the select the maximum value of the day only. so how i show the latest date? pls help me!!! :( Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.