Page 1 of 1

Storing Datetime in MS SQL server

Posted: Thu Jan 05, 2006 2:56 pm
by nawhaley
I'm trying to store the date and time in my MSSQL server but I cannot find any documentation on a valid way to enter this into the SQL database. do you have to get just the date then the time seperately and put them in , do you do it all as one line or what?

Posted: Thu Jan 05, 2006 3:15 pm
by nincha
never use mssql, but can you just use the php's date function then just query it to your database?

Posted: Thu Jan 05, 2006 3:28 pm
by nawhaley
not sure that will work the date() function itself lets you put the date and time in dozens of formats. I dont think all of those are valid to be stored in the SQL database and I'd rather not spend hrs trying to get one to take I'd rather know which ones are valid and which are not. Does anyone have a link going over this or know it off hand?

Posted: Thu Jan 05, 2006 3:31 pm
by nincha

Posted: Thu Jan 05, 2006 3:48 pm
by nawhaley
I had found both of those and he isnt very specifice in explaining his table layout so the examples make little sense in how you physically put the data into the database.

Posted: Fri Jan 06, 2006 6:18 pm
by Player1005
when you consult the "books online" that comes with MS SQL that is always a very good and reliable source for info.
with the query analyzer you can test our queries very comfortable.