输出查询到文本:参数太少,预期1

时间:2014-07-03 01:25:59

标签: sql sql-server database ms-access-2007 ms-access-2010

这是我的sql代码,如果有人可以帮助我查看它以及为什么它没有响应并给出错误消息。请注意,关系是:table1table2ResetFrequency连接; table1table3AccountNumber连接。

SELECT table1.EffectiveDate, table2.ResetFrequency, table3.Loan
FROM (table1 LEFT JOIN table2 ON table1.ResetFrequency = table2.ResetFrequency)
INNER JOIN table3 ON table1.AccountNumber = table3.AccountNumber
WHERE (table1.EffectiveDate) = [Enter Date: mm/dd/yyy];

2 个答案:

答案 0 :(得分:0)

使用以下格式:

SELECT z.EffectiveDate, z.ResetFrequency, table3.Loan
FROM (SELECT Table1.EffectiveDate, table2.ResetFrequency, table1.AccountNumber 
      FROM table1 
      LEFT JOIN table2 ON table1.ResetFrequency = table2.ResetFrequency)z
INNER JOIN table3 ON z.AccountNumber = table3.AccountNumber
WHERE (z.EffectiveDate) = [Enter Date: mm/dd/yyy];

答案 1 :(得分:0)

只需删除括号或括号

即可
SELECT table1.EffectiveDate, table2.ResetFrequency, table3.Loan
FROM table1 LEFT JOIN table2 ON table1.ResetFrequency = table2.ResetFrequency
INNER JOIN table3 ON table1.AccountNumber = table3.AccountNumber
WHERE table1.EffectiveDate = mm/dd/yyy;