I have following query which would list all of users appointments between 1970 and current day but I get error that datetime coused overflow. I tried everything but I still don't know how to resolve this.
select dodate,
header,
starttime,
stoptime,
userid,
custid,
objid,
infoid,
aname
from appointment
where dodate > 2440587
and DATEADD(d,dodate - 2440587,'1970-01-01') >= CONVERT(date,GETDATE())
and done=0
and del=0
and userid='ak'