If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
sort query results for a form
I have a simple query that gets all the results, that are not null, of one
column for a predetermined date from one table. The results are 5 different text labels of varying amounts depending on the month. the labels are 109, 231, 508, 606, 425. Is there any way of producing a report that will count these? i.e. Results for January 109=75 231=125 508=92 425=30 606=87 At the moment I export it to excel on completion and do a =counta() query. it just seems to me there would be a simpler, more elegant way to do this? I have attached the query code if it is of any use. SELECT [Ryder Mot].Area, [Ryder Mot].[Test Date] FROM [Ryder Mot] GROUP BY [Ryder Mot].Area, [Ryder Mot].[Test Date] HAVING ((([Ryder Mot].Area) Is Not Null) AND (([Ryder Mot].[Test Date]) Between #1/1/2004# And #2/1/2004#)) ORDER BY [Ryder Mot].Area; All help gratefully recieved --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.686 / Virus Database: 447 - Release Date: 14/05/2004 |
#2
|
|||
|
|||
sort query results for a form
Jeff,
At the moment, I can't really see any correspondence between the SQL of the query that you posted, and the description and example of what you've got. Also, I can't see why the SQL describes a Totals Query when there are no totals (aggregate functions) used in the query. But if your meaning is that you end up with 2 columns of data, and the 109, 231, etc refer to some sort of category code, and the 75, 125, etc refer to numerical values, then if you have a report based on this data, you can do this in the Report Footer section... put an unbound textbox there, and in its Control Source property put the equivalent of... =Sum([NameOfNumberField]) If you need further help with this, please post back with some more explanation. -- Steve Schapel, Microsoft Access MVP Jeff Lane wrote: I have a simple query that gets all the results, that are not null, of one column for a predetermined date from one table. The results are 5 different text labels of varying amounts depending on the month. the labels are 109, 231, 508, 606, 425. Is there any way of producing a report that will count these? i.e. Results for January 109=75 231=125 508=92 425=30 606=87 At the moment I export it to excel on completion and do a =counta() query. it just seems to me there would be a simpler, more elegant way to do this? I have attached the query code if it is of any use. SELECT [Ryder Mot].Area, [Ryder Mot].[Test Date] FROM [Ryder Mot] GROUP BY [Ryder Mot].Area, [Ryder Mot].[Test Date] HAVING ((([Ryder Mot].Area) Is Not Null) AND (([Ryder Mot].[Test Date]) Between #1/1/2004# And #2/1/2004#)) ORDER BY [Ryder Mot].Area; All help gratefully recieved |
Thread Tools | |
Display Modes | |
|
|