Jump to content

Recommended Posts

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

  • sqlhelp

    16

  • loveindia

    16

  • ceelogreen

    13

  • dotnetrockz

    4

Popular Days

Top Posters In This Topic

Posted

you should get the error only if your start date will be less than 01/01/1753 after you add -2 months to it or greater than 12/31/9999 after you add 3 months to the end date... otherwise you should never see that error...

 

check that man... fdi4g.gif

Posted

Max(ENDDATE),Min(ENDDATE)

 

 

sorry suborder table lo  max enddate 9999-12-31 00:00:00.000

 

mindate 1900-01-01 00:00:00.000

 

 

 

min startdate  1800-01-01 00:00:00.000

 

max startdate 2016-01-01 00:00:00.000

Posted

sorry suborder table lo  max enddate 9999-12-31 00:00:00.000

 

mindate 1900-01-01 00:00:00.000

 

thats the problem man... datetime format range is 9999-12-31... you are adding 3 more months to it which is causing a failure... fdi4g.gif

Posted

sorry suborder table lo  max enddate 9999-12-31 00:00:00.000

 

mindate 1900-01-01 00:00:00.000

 

so ur enddate value is already reached its allowable limit..so adding another 2 months will throw overflow error

Posted

propose something like changing the default value for '2999-12-31' for the end date... after you reach that date, you can take care of that again if needed man... fdi4g.gif

Posted

propose something like changing the default value for '2999-12-31' for the end date... after you reach that date, you can take care of that again if needed man... fdi4g.gif

 

Or use case statement to change the default to some lower date in ur query

Posted

Or use case statement to change the default to some lower date in ur query

 

can you please tell me ela cheyalo ? 

Posted

propose something like changing the default value for '2999-12-31' for the end date... after you reach that date, you can take care of that again if needed man... fdi4g.gif

ohk I donno if i can 

 

but that makes sense now  +2 add chesthe ne error vastundi 

Posted

Or use case statement to change the default to some lower date in ur query

 

malli case statement vaaditey, query execution waste and indexes waste man... what would be the difference between 2999 / 9999 man... If i am that developer, I will update all 9999's to 2999 man.... fdi4g.gif

Posted

can you please tell me ela cheyalo ? 

 

(dateadd(month,2,

CASE so.EndDate WHEN '9999-12-31' THEN getdate()

   ELSE so.EndDate END

) )

Posted

ohk I donno if i can 

 

but that makes sense now  +2 add chesthe ne error vastundi 

 

ya, don't do it without talking or making decisions... That's why I said in the answer also, propose it so that you can get credited for man.... This case is closed now man...fdi4g.gif

Posted

(dateadd(month,2,

CASE so.EndDate WHEN '9999-12-31' THEN getdate()

   ELSE so.EndDate END

) )

 

this will totally damage the whole idea of indexes kada man... it's just a turn around for the problem not a solution man... fdi4g.gif

Posted

ya, don't do it without talking or making decisions... That's why I said in the answer also, propose it so that you can get credited for man.... This case is closed now man...fdi4g.gif

 

 

y 2999 ?  ardham avaledhu ? 

Posted

malli case statement vaaditey, query execution waste and indexes waste man... what would be the difference between 2999 / 9999 man... If i am that developer, I will update all 9999's to 2999 man.... fdi4g.gif

 

agree.. but we dont know what exactly the table is used for at ..only sqlhelp would know.. for now to get the query into working state i told the solution

×
×
  • Create New...