View Full Version : DMax for dates


JCross
08-19-2002, 02:24 PM
hi all,

I need to find the InvoiceDate from tblInvoice that was most recently entered using frmInventory.InventoryDate as the criterea. For some reason I can't make my DMax work.

I have a query that finds the DMax date in the tblInvoice, but how do I get the InventoryDate field in as the criterea????I tried <=Forms!frmInventory!InventoryDate in the DMax field and it didn't work.

Thank you.

Jennifer

RV
08-19-2002, 02:45 PM
Basically, skip the DMax function, use Max:

SELECT Max(InvoiceDate)
FROM YourTable
WHERE InvoiceDate <=Forms!frmInventory!InventoryDate

If this isn't working for you (your info is
is rather common..), post your SQL statement and some more background info.

RV

JCross
08-19-2002, 02:56 PM
Thank you! I knew it was common - I just couldn't seem to make it work. Thanks for the answer.

Jennifer