22,209
社区成员
发帖
与我相关
我的任务
分享
for x=1 to 7
otherDay=date()+x
sql=sql&" select id,curordercode,curownername,firstcheckdate,dbo.getPrvCheckDate(ID,'"&otherDay&"') as PrvCheckDate from BaseInfo_t where DateDiff(day,FirstCheckDate,'"&otherDay&"')>=0"
sql=sql&" union"
next
sql=mid(sql,1,len(sql)-5)
where FirstCheckDate<convert(char(10),dateadd(d,1,otherday),120)