数据不匹配错误访问查询

时间:2013-10-03 14:32:14

标签: ms-access

我正在尝试使用left joinbetween函数获取特定时段的目标数据,如下面的代码所示。但是,当我运行代码时,当我删除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])))

1 个答案:

答案 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 "*")