存取中的SQL查询有问题

时间:2018-07-19 07:59:13

标签: sql windows ms-access

我进行了一个查询,该查询应该向我显示某些日期之间的延迟天数,由于某种原因,它在运行时不显示任何内容。 我有满足条件的数据。

SELECT JOB.JOB_ID, JOB.CUSTOMER, JOB.COUNTRY, QUOTATION.CLASSIFICATION, 
QUOTATION.INBOX_DATE, QUOTATION.TECH_EVALUATION_DATE, 
QUOTATION.COST_ANALYSIS_DATE, QUOTATION.PRICING_AND_QUOTATION_DATE, 
QUOTATION.OUTBOX_DATE, QUOTATION.INBOX_DELAY, 
QUOTATION.TECH_EVALUATION_DELAY, QUOTATION.COST_ANALYSIS_DELAY, 
QUOTATION.PRICING_AND_QUOTATION_DELAY, 


IIf([INBOX_DATE]=Null And [TECH_EVALUATION_DATE]=Null,0,DateDiff("w", 
[INBOX_DATE],[TECH_EVALUATION_DATE],2)) AS INBOX_DAYS,
IIf(TECH_EVALUATION_DATE=Null And COST_ANALYSIS_DATE=Null,0,DateDiff("w", 
[TECH_EVALUATION_DATE],[COST_ANALYSIS_DATE],2)) AS TECH_EVALUATION_DAYS, 
IIf(COST_ANALYSIS_DATE=Null And 
PRICING_AND_QUOTATION_DATE=Null,0,DateDiff("w",[COST_ANALYSIS_DATE], 
[PRICING_AND_QUOTATION_DATE],2)) AS COSTING_DAYS, 
IIf(PRICING_AND_QUOTATION_DATE=Null And OUTBOX_DATE=Null,0,DateDiff("w", 
[PRICING_AND_QUOTATION_DATE],[OUTBOX_DATE],2)) AS PRICING_DAYS,
IIf([OUTBOX_DATE]=Null And [ORDER].[ORDER_DATE]=Null,0,DateDiff("w", 
[OUTBOX_DATE],[ORDER].[ORDER_DATE],2)) AS OUTBOX_DAYS


FROM (JOB INNER JOIN QUOTATION ON JOB.[JOB_ID] = QUOTATION.[JOB_ID]) INNER 
JOIN [ORDER] ON JOB.JOB_ID = ORDER.JOB_ID
WHERE (((QUOTATION.CLASSIFICATION)="Special") AND 
((Year([QUOTATION.INBOX_DATE]))=Year(Now())) AND 
((Month([QUOTATION.INBOX_DATE]))=Month(Now())-1));

0 个答案:

没有答案