Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Problem with datetime when calling stored procedur

Author  Topic 

Mamatha
Posting Yak Master

102 Posts

Posted - 2005-01-18 : 07:37:06
Hi

we write a small stored procedure to insert values into a table.Table contains two fields,those are info and createddate.Info caontains datatype as text and createddate contains datetime.we tried to pass parameters to stored procedured from my ASP page.But it gives an error like <b>Syntax error converting datetime from character string.
/Intranet/example.asp, line 17</b>

my original code:

<body>
<%
statusinfo="hai"
dateinfo=2/1/2005 '3:22:33 AM
'dateinfo=now
varsql="p_status'"&statusinfo&"','"&dateinfo&"'"
conn.execute(varsql)
response.write("executed")
%>
</body>

please give me the solution,thanks in advance.



Mamatha

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-18 : 08:17:28
format the date as yyyymmdd hh:mm:ss

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -