I have successfully written the following query that calculates the difference between two fields (deliveries and invoices) and divides this figure by deliveries/5 (for the week):
I now want the same total for the month, where an entry exists for each month. Entering 30 instead of 5 works fine, but since not all months have 30 days I had the idea of counting by the number of entries, hence I wrote:
But this now just produces a "Cannot have aggregate function in expression" error.
Can someone please help me to make this right?
Many thanks,
Stuart
Code:
Days to Invoice: (Sum([deliveries value]-[invoices value]))/(Sum([deliveries value]/5))
I now want the same total for the month, where an entry exists for each month. Entering 30 instead of 5 works fine, but since not all months have 30 days I had the idea of counting by the number of entries, hence I wrote:
Code:
Days to Invoice: (Sum([deliveries value]-[invoices value]))/(Sum([deliveries value]/Count([deliveries value])))
But this now just produces a "Cannot have aggregate function in expression" error.
Can someone please help me to make this right?
Many thanks,
Stuart