hansmtbank
asked on
Date in MS SQL statement
Hi!
I try to execute MS SQL statement.
insert MyTable (MyDate, MyValue) values (10/30/1998, 2.5)
"Operand type clash: int is incompatible with datetime"
Please help me! How can I insert date field in SQL statemanet?
I try to execute MS SQL statement.
insert MyTable (MyDate, MyValue) values (10/30/1998, 2.5)
"Operand type clash: int is incompatible with datetime"
Please help me! How can I insert date field in SQL statemanet?
ASKER
No, I can't use parameters.
Why not? can you give some details?
ASKER
Thank you! I inserted date as "dd.mm.yyyy". I have to setup date format on MS SQL server.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dates normally have to be quoted '10/30/1998'.
Also the default language date format of the user you are logged in as applies.
Use Instlang.sql on the MS SQL Install cd to install diferent languages...
Use the sp_setlanguage or sp_setdefaultlanguage to set which language is used by which user.
One last note. Consider using long dates to make the app international.
ie use "30 October 1998"..
hope this helps..
Also the default language date format of the user you are logged in as applies.
Use Instlang.sql on the MS SQL Install cd to install diferent languages...
Use the sp_setlanguage or sp_setdefaultlanguage to set which language is used by which user.
One last note. Consider using long dates to make the app international.
ie use "30 October 1998"..
hope this helps..
insert MyTable (MyDate, MyValue) values (:mydate, 2.5)
then:
yourquery.parambyname('myd