G
Guest
Hi All!
I have a simple table
Prod_ID
Cost
Date
My Prod_ID and Date are filtered throught the form's criteria. I'd like to
be able to get the max date from a table if the given criteria doesn't exist
in the table.
I know how to get it using vb, but I thought that I could escape from
writing a code.
So far I came up with this in my query for the date:
IIf(([tblNewItemCost]![Date_YMD]<>[Forms]![frmMain]![Text0] And
[tblNewItemCost]![Date_YMD]<>[Forms]![frmMain]![Text2])
,Max([NewItemCostTbl]![Date_YMD]),([tblNewItemCost]![Date_YMD]>=[Forms]![frmMain]![Text0] And [tblNewItemCost]![Date_YMD]<=[Forms]![frmMain]![Text2]))
I am getting aggregate function error.
Any reply will be greatly appreciated.
I have a simple table
Prod_ID
Cost
Date
My Prod_ID and Date are filtered throught the form's criteria. I'd like to
be able to get the max date from a table if the given criteria doesn't exist
in the table.
I know how to get it using vb, but I thought that I could escape from
writing a code.
So far I came up with this in my query for the date:
IIf(([tblNewItemCost]![Date_YMD]<>[Forms]![frmMain]![Text0] And
[tblNewItemCost]![Date_YMD]<>[Forms]![frmMain]![Text2])
,Max([NewItemCostTbl]![Date_YMD]),([tblNewItemCost]![Date_YMD]>=[Forms]![frmMain]![Text0] And [tblNewItemCost]![Date_YMD]<=[Forms]![frmMain]![Text2]))
I am getting aggregate function error.
Any reply will be greatly appreciated.