query for daily as well as cumulaive for month (1 Viewer)

Ramnik

Registered User.
Local time
Today, 14:25
Joined
Jul 12, 2012
Messages
145
hello everyone,
i have a production application in which i have a table named daily_production with fields as ( prod_id, date, productname, qty ).
now i want a daily production query as

date : xx-xx-xxxx
productname | qty | monthlysum(for thsi product) | daily average |

i want this on a single query so that i can make a report out of this .
this seems quite simple but i m stuck . any help would be much appreciated. thankssssssss
 

Ramnik

Registered User.
Local time
Today, 14:25
Joined
Jul 12, 2012
Messages
145
hello everyone,
i m sending this attachment to further elaborate my question ...
i need monthly sum from daily production table for the product in that row. thankssss
 

Attachments

  • DAILY PRODUCTION QUERY.JPG
    DAILY PRODUCTION QUERY.JPG
    99.6 KB · Views: 76

JHB

Have been here a while
Local time
Today, 10:55
Joined
Jun 17, 2012
Messages
7,732
Hmmm - how do you want the monthlysum calculated? date : xx-xx-xxxx minus one month or?
 

Ramnik

Registered User.
Local time
Today, 14:25
Joined
Jul 12, 2012
Messages
145
No i want for the current month from the date we entered ( Month(Productiondate) )
 

Brianwarnock

Retired
Local time
Today, 09:55
Joined
Jun 2, 2003
Messages
12,701
I see that you are grouping on production date, so drag it into the grid a second time for the Where condition which will be
Between dateserial(year(productiondate),month(productiondate),0) And Dateserial(year(productiondate),month(productiondate)+1,0)

Brian
 

Ramnik

Registered User.
Local time
Today, 14:25
Joined
Jul 12, 2012
Messages
145
thanks for ur suggestion nd this is the modification i have done but still the passquantity shows exact values from that day only . i think there are more things i should do . dont know ......
 

Attachments

  • DAILY PRODUCTION QUERY1.jpg
    DAILY PRODUCTION QUERY1.jpg
    84.7 KB · Views: 75

Brianwarnock

Retired
Local time
Today, 09:55
Joined
Jun 2, 2003
Messages
12,701
It is impossible to do daily and monthly in one query, that is what reports are for.
To get it by month you would have to group on Month(productiondate)

What is the criteria under the productiondate in your original

Brian
 

Ramnik

Registered User.
Local time
Today, 14:25
Joined
Jul 12, 2012
Messages
145
nothing that is just a date picker box to specify the date .
 

Ramnik

Registered User.
Local time
Today, 14:25
Joined
Jul 12, 2012
Messages
145
moreover if i have separate queries as daily and monthly ... how i will create a report out of this as :
date : xx:xx:xxxx
productname | passqty | monthlysum
xxxxxxxxxx | xxxx | xxxx

thanksssss...
 

Brianwarnock

Retired
Local time
Today, 09:55
Joined
Jun 2, 2003
Messages
12,701
moreover if i have separate queries as daily and monthly ... how i will create a report out of this as :
date : xx:xx:xxxx
productname | passqty | monthlysum
xxxxxxxxxx | xxxx | xxxx

thanksssss...

That looks like a monthly report with no daily details, unless that monthly sum is a daily running total for the month.

Brian
 

Ramnik

Registered User.
Local time
Today, 14:25
Joined
Jul 12, 2012
Messages
145
yes its a running total sum for the month from the date specified.
 

Brianwarnock

Retired
Local time
Today, 09:55
Joined
Jun 2, 2003
Messages
12,701
That is done in the Report, search the report forum for running sum

Brian
 

Users who are viewing this thread

Top Bottom