Adding a value to a 'datetime' column caused overflow.
i am getting the error "Adding a value to a 'datetime' column caused overflow." when I try and run this statement. DATEADD(dd, - 365, p.LASTMISSEDAPPT) < pl.PLDATE. how can I change DATEADD(dd, - 365, p.LASTMISSEDAPPT) to avoid this.
Thanks
Microsoft SQL Server
Last Comment
running32
8/22/2022 - Mon
Guy Hengel [angelIII / a3]
what are values in the 2 fields? you might hit min value of date ...what about:
If p.LASTMISSEDAPPT is a float "representing" a date, then this value is likely
to be too high. If it exceeds 2936549 you will get an out or range error
(or similar error). If it represents a date, you should cast it to a
datetime.
running32
ASKER
Example of a field is the value of the fields could be 9/7/2010. It still does it when I cast the value as datetime 101. thanks
Open in new window