Jump to content

Recommended Posts

Posted

pls help sql server oka query undi 

 

select p.ID,  g.ID, g.Name

from Person p

join Group g on g.Name = 'Members' 

join Sub s on s.subid = p.LinkID and s.orderID = 3

join Suborder so on so.subid = s.id

where cast(getdate() as date) between (dateadd(month,-3,so.StartDate)) and (dateadd(month,2,so.EndDate) )

 

 

I am trying to change a subscription period where startdate is -3 months and  enddate is +2 months from the subscription time  but  error vasthundi 

 

Adding a value to a 'datetime' column caused an overflow.

 

what mistake am i doing ?  pls help. 

  • 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

where cast(getdate() as date) between (dateadd(mm,-3,so.StartDate)) and (dateadd(mm,2,so.EndDate) )

 

Tyr cheyi

Posted

Person p badhulu person NTR
Group g badhulu group tdp Ani ichhi execute cheyali direct result tho patu pakkana printer lo report b generate avvudhhi Ani chandrabhai cheppamannadu

Ltt for expers

Posted

Person p badhulu person NTR
Group g badhulu group tdp Ani ichhi execute cheyali direct result tho patu pakkana printer lo report b generate avvudhhi Ani chandrabhai cheppamannadu

Ltt for expers

 

hey yesesaavu gaaa

Posted

 

where cast(getdate() as date) between (dateadd(mm,-3,so.StartDate)) and (dateadd(mm,2,so.EndDate) )

 

Tyr cheyi

 

 

 

already tried same error 

Posted

exact error msg postuuuu here

 

 

this is the error 

 

 

Adding a value to a 'datetime' column caused an overflow.

Posted

pls help sql server oka query undi 

 

select p.ID,  g.ID, g.Name

from Person p

join Group g on g.Name = 'Members' 

join Sub s on s.subid = p.LinkID and s.orderID = 3

join Suborder so on so.subid = s.id

where cast(getdate() as date) between (dateadd(month,-3,so.StartDate)) and (dateadd(month,2,so.EndDate) )

 

 

I am trying to change a subscription period where startdate is -3 months and  enddate is +2 months from the subscription time  but  error vasthundi 

 

Adding a value to a 'datetime' column caused an overflow.

 

what mistake am i doing ?  pls help. 

 

 

Error Screenshot pettu

Posted

are u getting results when u hardcod the date like '11/1/2014' and 1/1/12015?

Posted

Valid Date Range for SQL Server Date/Time Data Types

Values for datetime data types earlier than January 1, 1753 are not permitted in SQL Server. SQL Server rejects all values that do not fall within the range from 1753 to 9999.

Another SQL Server data type, smalldatetime, stores dates and times of day with less precision than datetime datatype. Valid date range for this data type is from January 1, 1900 through June 6, 2079.

 

Posted

Valid Date Range for SQL Server Date/Time Data Types

Values for datetime data types earlier than January 1, 1753 are not permitted in SQL Server. SQL Server rejects all values that do not fall within the range from 1753 to 9999.

Another SQL Server data type, smalldatetime, stores dates and times of day with less precision than datetime datatype. Valid date range for this data type is from January 1, 1900 through June 6, 2079.

 

 

instead of using datetime2   , i did a check in c# itself and modified date  before calling stored procedure couple of days back.. bye1 bye1

Posted

ala raakoodadhe.. anyway try type casting so.StartDate/EndDate  to date

Posted

this is the error 

 

 

Adding a value to a 'datetime' column caused an overflow.

 

startdate and enddate formats enti? please post here

Posted

check ur table data...first sometimes end date column ni max time ki default ga insertc hestharu so if ur trying to increment that by 2 months overflow vasthundhi.....for this u can filter by adding a condition tow here clause

Posted

do this...

select p.ID,  g.ID, g.Name
from Person p
join [Group] g on g.Name = 'Members' 
join Sub s on s.subid = p.LinkID and s.orderID = 3
join Suborder so on so.subid = s.id
where cast(getdate() as datetime) between (dateadd(month,-3,so.StartDate)) and (dateadd(month,2,so.EndDate) )

or

 

select p.ID,  g.ID, g.Name
from Person p
join [Group] g on g.Name = 'Members' 
join Sub s on s.subid = p.LinkID and s.orderID = 3
join Suborder so on so.subid = s.id
where getdate() between (dateadd(month,-3,so.StartDate)) and (dateadd(month,2,so.EndDate) )

 

my message is chopped of earlier, so editing again...

 

if the start date is very very primitive, and -3 gives an overflow error, then it might give this error also... fdi4g.gif

 

×
×
  • Create New...