我正在尝试使用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])))
答案 0 :(得分: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 "*")