Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

forgive me for asking this question......

Status
Not open for further replies.

threeo

Programmer
Mar 31, 2005
49
US
i have forgotten how to do this and i've been scouring the internet and can't believe i can't find the correct syntax....

all i want to do is save the value for Now() to my database.

the original value is like: 8/23/2005 9:26:45:18 PM

this is how the dates appear in the table i'm trying to save to:
2/20/2004 1:25:25 PM
and they are in datetime format

i've tried all kinds of configurations like:

CONVERT(datetime, '2005-08-23-092645', 101)

etc but always get
"error converting datetime from character string" errors
 
Have you tried DateToStr and StrToDate functions ?
 
Ops My mistake I though I am in the Delphi forum. In ASP.NET should be DateTime.Parse() and .ToString().
 
hey thanks...

i am building a query string which will be sent to sql server so....

i am trying to figure out how to do this in sql server rather than in .net


 
why not use GetDate() function of SQL server???

Known is handfull, Unknown is worldfull
 
i found the answer.....

it was:

CONVERT(datetime,'2005-08-28 09:23:16.32',101)


thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top