Apr 03 2022 03:01 PM - edited Apr 03 2022 04:05 PM
Hello Experts,
I am trying to add a between condition to the following.
Rate2: Format(DLookUp("Rate","qryPricing","ID=" & [ProjID] & "[dte] between [DateStart] and [DateEnd]"),"Percent")
I know there is something wrong with the syntax after the & sign but I cant figure it out.
In English, I am looking for the qryPricing.[rate] on [projID] where [dte] is between qryPricing.[DateStart] and qryPricing.[DateEnd]
Note: qryPricing is not in the query. The [DateStart] and [DateEnd] are both in qrypricing.
thank you very much.
Let me know if there are any questions.
Apr 03 2022 09:30 PM
Apr 04 2022 03:26 AM
HI Arnel,
[dte] is tblLetterOfCredit.UltimateExpirey (it does have an IIF statement if that matters)
SELECT tblLetterOfCredit.LCID, DateSerial([y],[m],Day([UltimateExpirey])) AS dte
FROM tblLetterOfCredit, zzTblMonths, zzTblYears
WHERE (((DateSerial([y],[m],Day([UltimateExpirey]))) Between IIf([DateOfIssue] Is Null,[ExpectedDateOfIssue],[DateOfIssue]) And [UltimateExpirey]) AND ((tblLetterOfCredit.UltimateExpirey) Is Not Null))
ORDER BY tblLetterOfCredit.LCID, DateSerial([y],[m],Day([UltimateExpirey]));
here is a screen shot of the above SQL:
FYI: the dlookup did not return anything but NULL.
Let me know what is next.
Apr 07 2022 06:08 AM