View Full Version : DAvg Formulla In Access Query


djwasim
07-21-2009, 09:58 PM
i am using DAvg formula in a report field [avgrate] as.........

=DAvg("[Rate]","Main Query","[TranDate]<=[Reports]![Issue Plot/w]![Trandate] AND [Rate]>0 and [Itemdes] = '" & [Itemdes] & "'")

but when i want to sum this field in report i dont get any result

now i want to use this formula in query named [consumption query] but i dont know that which formula i use in query?

plz help me:o

jzwp22
07-22-2009, 08:35 AM
Regarding your report question, you might try this if the TranDate field in your main query is date/time datatype:

=DAvg("[Rate]","Main Query","[TranDate]<=#" & [Reports]![Issue Plot/w]![Trandate] & "# AND [Rate]>0 and [Itemdes] = '" & [Itemdes] & "'")

As to your query question, we need to know how the consumption query is related to your Main Query or more basically what does your table structure look like. Can you explain in more detail what you are trying to do?

djwasim
07-22-2009, 11:08 PM
Actually i am not using the Transaction Date From "Main Query"

I am Using Transaction Date From "Issue Query"
And i am also using this formula in that Query named "issue Query"

jzwp22
07-23-2009, 03:59 AM
It doesn't matter what query you are using the DAvg() function in since the domain aggregate functions are used to pull information from other tables/queries. If we had some more detail on your table structure (table names, field names, relationships between tables) we might be better able to help you out. Can you provide more information?