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
 General SQL Server Forums
 New to SQL Server Programming
 Pass date to sp in Query analyzer

Author  Topic 

Pinto
Aged Yak Warrior

590 Posts

Posted - 2007-03-30 : 08:56:46
I am trying to run an sp in query analyzer like this. It expects two parameters a number and a date.

Exec "spGetCancelleddates" "351", "30/03/07"

However I get an error on the date

Error converting data type nvarchar to datetime.

How should I pass this parameter ?

TIA

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-30 : 08:58:11
Exec spGetCancelleddates '351', '20070330'


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Pinto
Aged Yak Warrior

590 Posts

Posted - 2007-03-30 : 09:03:55
Thx
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-04-02 : 02:56:48
<<
How should I pass this parameter ?
>>

You should always pass date literals in ISO format YYYYMMDD as suggested to avoid date setting problems

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -