I am in the process of creating an inventory database. The kicker is that certain things get a certain amount of free time before storage charges begin. I put this expression in the query to show the number of days we have had the item: # of Days: (Date()-[Date]). [Date] is the date we recieved it. This works fine. Now we have a customer that wants the storage to show on the daily inventory report. Here is the criteria:<br>Item1 - 5 free days $5 a day after that<br>Item2 - 30 free days $0.70 a day after that<br>Item3 - 30 free days $0.50 a day after that.<br><br>Here is the IIf statement that I wrote :<br>Item1 Ch: IIf(([Empty/Loaded]="L"
And ([# of Days]>5),5,0)<br>Item2 Ch: IIf(([Empty/Loaded]="E"
And ([# of Days]>30),0.70,0)<br>Item3 Ch: IIf(([Empty/Loaded]=""
And ([# of Days]>30),0.50,0)<br>All of that works fine, but I need to have totals on the report.<br><br>Here is the IIf statement that I wrote :<br>Total Item1 Ch: Sum(IIf(([Empty/Loaded]="L"
And ([# of Days]>5),5,0))<br><br>I get this error when I try to run the query :<br>You tried to execute a query that doesn't include the specified expression 'Date' as part of an aggregate function.<br><br>I have no clue what I am doing wrong. If somebody knows something please enlighten me.<br><br><br>Thank You!!<br><br>