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.
| Author |
Topic |
|
ramana123
Yak Posting Veteran
57 Posts |
Posted - 2005-08-29 : 02:29:01
|
| HI HERE I HAVE TO PASS THE DATE VALUE TO THE sp ..WHILE TRY TO PASS THAT AS LIKE BELOW IT SHOWS ERROR ASINVALID CONVERSAION VARCHAR TO DATE ..PLS HELP ME OUT..!!DECLARE @A DATETIMESET @A='22-1-2005'EXEC CFG_WORKITEM_UPD @A,1 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-29 : 02:30:47
|
| Pass it in yyyymmdd formatDECLARE @A DATETIMESET @A='20050122'EXEC CFG_WORKITEM_UPD @A,1MadhivananFailing to plan is Planning to fail |
 |
|
|
ramana123
Yak Posting Veteran
57 Posts |
Posted - 2005-08-29 : 02:34:35
|
| hi thanks it s wporking fine but..small doubt sqlserver defaultly take in the formatt of yyyymmdd format ..suppose i want give date like ddmmyyyy then what i need to do.. |
 |
|
|
kapilarya
Yak Posting Veteran
86 Posts |
Posted - 2005-08-29 : 02:49:22
|
| try this SET DATEFORMAT dmyGODECLARE @datevar datetimeSET @datevar = '31/12/98'SELECT @datevarGOKapil Arya |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-29 : 02:51:11
|
| you need to use format function in your Fron end applicationor in SQL use convert function Convert(varchar,Date,112)MadhivananFailing to plan is Planning to fail |
 |
|
|
ramana123
Yak Posting Veteran
57 Posts |
Posted - 2005-08-29 : 03:23:42
|
| hi kapil..it doesnt work what you have mentioned in aboue post..i tried like this..set dateformat dmyset @a ='11032005'but while try to execute the SP it shows the error like invlid conversion b/n varchar to date. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-29 : 03:38:02
|
| Dont use DateFormatUse the method I suggestedMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|