dear all,
how can i use red column alias in sub query?
SELECT CDate(Format([ETW],"dd-mmm-yy")) AS D_Date,
YardJobMng.CNTRNo, YardJobMng.Job,
(SELECT format(MAX(ETW),"dd-mmm-yy") FROM YARDJOBmng AS YJ WHERE yj.job = "DS" and yj.CNTRNo = YARDJOBMNG.CNTRNo AND FORMAT(YJ.ETW,"DD-MMM-YY") = YardJobMng.D_Date) AS DS
FROM YardJobMng
GROUP BY CDate(Format([ETW],"dd-mmm-yy")), YardJobMng.CNTRNo, YardJobMng.Job
HAVING (((CDate(Format([ETW],"dd-mmm-yy"))) Between #2/1/2016# And #2/29/2016#) AND ((YardJobMng.CNTRNo)="03650") AND ((YardJobMng.Job) In ("DS")))
ORDER BY CDate(Format([ETW],"dd-mmm-yy")), YardJobMng.CNTRNo;
how can i use red column alias in sub query?
SELECT CDate(Format([ETW],"dd-mmm-yy")) AS D_Date,
YardJobMng.CNTRNo, YardJobMng.Job,
(SELECT format(MAX(ETW),"dd-mmm-yy") FROM YARDJOBmng AS YJ WHERE yj.job = "DS" and yj.CNTRNo = YARDJOBMNG.CNTRNo AND FORMAT(YJ.ETW,"DD-MMM-YY") = YardJobMng.D_Date) AS DS
FROM YardJobMng
GROUP BY CDate(Format([ETW],"dd-mmm-yy")), YardJobMng.CNTRNo, YardJobMng.Job
HAVING (((CDate(Format([ETW],"dd-mmm-yy"))) Between #2/1/2016# And #2/29/2016#) AND ((YardJobMng.CNTRNo)="03650") AND ((YardJobMng.Job) In ("DS")))
ORDER BY CDate(Format([ETW],"dd-mmm-yy")), YardJobMng.CNTRNo;