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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stored procedure can't execute date format problem

Status
Not open for further replies.

xtremeLogic

Programmer
Dec 19, 2003
53
CA
Hi,

I have a sql server stored procedure that I would like to execute from vb.net. The problem is that it won't complete the insert into the table because of the date being sent. I am getting the date from a form field so I format it like

Format("{0:MM/dd/yyyy}", docDate)

However, it does not complete the stored proc due to the date format being too long. I traced the execution of the stored proc and got the following date parameter being sent to the db:
'Jan 20 2004 12:00:00:000AM'
The problem with that is that because of the length of it, the db doesn't accept. The field in my db is of type datetime.

Any suggestions would be greatly appreciated
 
Hi xtreemLogic
You don't have to convert the datetime sent from VB .net
if you just sent the date and in SP you variable(parameter) of SP is datetime then you don't have to worry about anything...VB .net dates goes fine with SQL Server as i have done it serveral time
Regards
Nouman

Nouman Zaheer
Software Engineer
MSR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top