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

Datatype problem with stored proc

Status
Not open for further replies.

simma

Programmer
Sep 11, 2001
398
0
0
US
Hello,
I have two datetime parameters in stored proc.But when I run it in crystal reports its gives error.If I change datatype to varchar then it runs ok.
Please Advice.
Thanx
 
I prefer to use varchar or char for date parameters in a stored procedure. SQL will handle the conversion if comparing to a datetime field in a query. I've had far fewer difficulties when using these data types to pass dates to the SP. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
I agree with Terry, crystal seems to have major problems dealing with date parameters in stored procs. We came to the same conclusion in my office pass it as a char or varchar and let sql deal with converting it.
 
How the stored procedures interpret dates parameters depends on the Language of the login. An sp with code such as

TheDate BETWEEN '12/06/02' AND '19/06/02'

will work fine for a British English login, but not for an English (US) login.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top