此MS Access sql语句到MS SQL语句的转换是什么
Select *
from iapt
where appt_id in (Select distinct appt_id
from iaptd where po_id in(Select distinct po_id
from irct
where verify_dtim = Date()-1))
答案 0 :(得分:1)
我想您只需要更改
Date() - 1
到
DATEADD(dd, -1, CAST(GETDATE() AS DATE))
答案 1 :(得分:1)
从GETDATE()
(今天)开始减去一天。
Select *
from iapt
where appt_id in (Select distinct appt_id
from iaptd where po_id in(Select distinct po_id
from irct
where verify_dtim = DATEADD(day, -1, convert(date, GETDATE())))