0

我正在尝试使用下面的代码left join来获取特定时期的目标数据。between但是,当我运行代码时出现数据不匹配错误,当我删除betwwen代码时,查询运行正常。

尝试玩括号,直到现在还没有运气。

FROM Qry_Status 
LEFT JOIN Qry_Target ON (Qry_Status.[Dept Code] = Qry_Target.[Dept Code]) 
And (iif(IsDate(Qry_Status.sDate),Qry_Status.sDate Between ([Qry_Target].[From_Date]) 
And ([Qry_Target].[To_Date])))
4

1 回答 1

0

尝试这个:

FROM Qry_Status 
LEFT JOIN Qry_Target ON (Qry_Status.[Dept Code] = Qry_Target.[Dept Code]) 
And (iif(IsDate(Qry_Status.sDate),Qry_Status.sDate Between Qry_Target.[From_Date] 
And Qry_Target.[To_Date]), Qry_Status.sDate LIKE "*")
于 2013-10-03T17:05:45.637 回答