SELECT DISTINCT [Billlist].[billno] [Bill No.],temp.[BillDate] [Date],[Billlist].[user] [Customer Name],[Billlist].[total] Total,[paid] Paid,[discount] Discount
FROM temp
JOIN [Billlist] ON temp.[billno]=[Billlist].[billno]
WHERE itemDetail.[BillDate] BETWEEN '9/19/2014' and '9/19/2014'
我该怎么办?
我需要过滤,但如果我使用我有错误!
任何人都要尽快回复我。
答案 0 :(得分:0)
除非itemDetail.[BillDate]
在where子句中确实应该是temp.[BillDate]
,否则您需要将itemdetail
表与相应的表一起加入。
根据列名称,我猜测您的查询应如下所示:
SELECT DISTINCT
[Billlist].[billno] [Bill No.],
temp.[BillDate] [Date],
[Billlist].[user] [Customer Name],
[Billlist].[total] Total,
[paid] Paid,
[discount] Discount
FROM temp
JOIN [Billlist] ON temp.[billno] = [Billlist].[billno]
WHERE temp.[BillDate] BETWEEN '9/19/2014' and '9/19/2014'