J
Jim Franklin
Hi,
I have two tables, tbl_Orders and tbl_Letters. Both have a common Cust_ID
field and each has a date field, Order_Date and Letter_Date respectively.
Each customer may have several letter s and several orders.
I am trying to write a query that, for every letter in my tbl_Letters, tells
me the date of the last order placed by the customer BEFORE receiving that
letter (i.e. ignoring any orders placed afterwards)
It sounds simple, but I have been using a select query on tbl_Letters with a
DMAX function, but this does not work. The expression I am using is
DMax("[Order Date]","Orders","[Order Date] < #" & [Letter_Date] & "# AND
[Customer ID] = " & [Cust_ID])
My date fields are formatted as dd/mm/yy - does this matter? And is this the
correct way to do it?
Thanks as always for any help,
Jim F.
I have two tables, tbl_Orders and tbl_Letters. Both have a common Cust_ID
field and each has a date field, Order_Date and Letter_Date respectively.
Each customer may have several letter s and several orders.
I am trying to write a query that, for every letter in my tbl_Letters, tells
me the date of the last order placed by the customer BEFORE receiving that
letter (i.e. ignoring any orders placed afterwards)
It sounds simple, but I have been using a select query on tbl_Letters with a
DMAX function, but this does not work. The expression I am using is
DMax("[Order Date]","Orders","[Order Date] < #" & [Letter_Date] & "# AND
[Customer ID] = " & [Cust_ID])
My date fields are formatted as dd/mm/yy - does this matter? And is this the
correct way to do it?
Thanks as always for any help,
Jim F.