Wednesday, March 28, 2012

How to insert date into database SQL 2000?

How to insert date into database SQL 2000 that the date read from server ?INSERT INTO tableName ( dateCOlumn) VALUES ('4 Jul 2003')

now if this isn't what you want, how about you post again with some actual detail?|||Opps sorry... i means... first, how to to declare the date using asp.net language... then how to insert it into database|||in VB you can just use Now()

in C# use DateTime.Now;

concatenate that into a SQL string, or assign it to a parameter of a command, then execute it and away you go.|||How can i divide the date and time separately. for example... i want to generate a search coding. its can search the data by day, month or year. I think in my case, the time is not important but I still need the information as knowledge. my problem is, the date that i insert into database keep the full date format. can u solve my problem & recommend any good references. Sorry... i'm still new in asp.net|||well, you can do that in your SQL Code with DatePart() or in .NET take a look under "DateTime object" in the documentation - there's a lot of stuff in there.sql

No comments:

Post a Comment