I
iori
SELECT DISTINCT C1.SKU, P.SKU_Desc, C1.COST_ExW, C2.COST_ExW, C1.REGION,
C2.Cost_ExW-C1.cost_ExW AS CostDiff, Format(C1.EFF_DATE,"mm-dd-yyyy") AS
Expr1, C2.EFF_DATE
FROM (COST_SKU AS C1 INNER JOIN ALLPRODUCT AS P ON C1.SKU=P.SKU) INNER JOIN
COST_SKU AS C2 ON (C2.EFF_DATE< C1.EFF_DATE) AND (C2.SKU=C1.SKU)
WHERE C1.REGION="NA" AND C2.REGION="nile" AND C2.SKU=P.SKU
ORDER BY Format(C1.EFF_DATE,"mm-dd-yyyy") DESC;
i want to select only the first record from C2 where C2.EFF_DATE<C1.EFF_DATE
how can i do that? help!
C2.Cost_ExW-C1.cost_ExW AS CostDiff, Format(C1.EFF_DATE,"mm-dd-yyyy") AS
Expr1, C2.EFF_DATE
FROM (COST_SKU AS C1 INNER JOIN ALLPRODUCT AS P ON C1.SKU=P.SKU) INNER JOIN
COST_SKU AS C2 ON (C2.EFF_DATE< C1.EFF_DATE) AND (C2.SKU=C1.SKU)
WHERE C1.REGION="NA" AND C2.REGION="nile" AND C2.SKU=P.SKU
ORDER BY Format(C1.EFF_DATE,"mm-dd-yyyy") DESC;
i want to select only the first record from C2 where C2.EFF_DATE<C1.EFF_DATE
how can i do that? help!