Monthly Trend

D Willett
SilverLounger
Posts: 1728
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Monthly Trend

Post by D Willett »

Hi

I'm trying to create a chart from the following query:

SELECT tblEST.Finished, tblEST.STA, tblEST.VEH_MAK
FROM tblEST
GROUP BY tblEST.Finished, tblEST.STA, tblEST.VEH_MAK
HAVING (((tblEST.Finished)>=[forms]![frmStatus]![txtDateFrom] And (tblEST.Finished)<=[forms]![frmStatus]![txtDateTo]) AND ((tblEST.STA)="F") AND ((tblEST.VEH_MAK)=[forms]![frmStatus]![lstVehTrend]));

I need the months along the bottom and the count of vehicles in the detail, so if I select 01/01/2010 thru 30/06/2010 I will see 6 months of trend.

I'm struggling ..............
Cheers ...

Dave.

User avatar
HansV
Administrator
Posts: 78523
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Monthly Trend

Post by HansV »

Hi Dave,

I think you need a query like this:

SELECT tblEST.Finished, Count(*) AS NumberOfVehicles
FROM tblEST
WHERE (tblEST.Finished Between [Forms]![frmStatus]![txtDateFrom] And [Forms]![frmStatus]![txtDateTo]) AND (tblEST.STA="F") AND (tblEST.VEH_MAK=[Forms]![frmStatus]![lstVehTrend])
GROUP BY tblEST.Finished
Best wishes,
Hans

D Willett
SilverLounger
Posts: 1728
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Re: Monthly Trend

Post by D Willett »

Brilliant Hans..

I can use this template for other graph's I'm working on.

Are you watching the Footie ??

Regards
Cheers ...

Dave.

User avatar
HansV
Administrator
Posts: 78523
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Monthly Trend

Post by HansV »

Frankly, I'm not much interested in football, but it's great that both England and The Netherlands are through.
Best wishes,
Hans

D Willett
SilverLounger
Posts: 1728
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Re: Monthly Trend

Post by D Willett »

lol Patriotic !!

Have a great weekend.. :-)
Cheers ...

Dave.

User avatar
HansV
Administrator
Posts: 78523
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Monthly Trend

Post by HansV »

Have a great weekend too! (It has finally, finally become summer here)
Best wishes,
Hans