473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How to multigroup a report without any condition? Access 2007

Dear All,

I came up on such a report and couldnt figure out how to design it also to code any of it.

I have one table:
Expand|Select|Wrap|Line Numbers
  1. -------------------------------
  2. Desc | Entity |  Name  | rate | qty
  3. ---------------------------------
  4. xxxx    1        Mark    100     1
  5. xxxx    2        Mark    100     2
  6. xxxx    1        Joe     100     3
  7. xxxx    2        Kive    100     4
  8. xxxx    1        Ben     100     5
  9. xxxx    1        Ben     100     6
  10. -----------------------------------
  11.  
I want to run a report that looks like this:

Expand|Select|Wrap|Line Numbers
  1.   |   Mark    Joe   Kive   Ben
  2. =================================
  3. 1     100     300    0     1100
  4. =================================
  5. 2     200     0      400    0
  6. =================================
  7.  
  8.  
filtering by entity is easy , but filtering or sorting the names horizantaly, .... was not at all, like have no idea how to.

Any body can help ????

thanks a lot
Apr 4 '11 #1

✓ answered by Lysander

I have deleted the table I made, so can't test this, but this code should give you the total per row.
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum([rate]*[qty]) AS Expr1 
  2. SELECT TEST.name, Sum([rate]*[qty]) AS [Total]
  3. FROM TEST 
  4. GROUP BY TEST.name
  5. ORDER BY TEST.Name DESC  
  6. PIVOT TEST.entity; 
  7.  

7 1680
thinking of :
On load event of this report take the value of the textbox that displays the entity, then call a function to calculate the total for each name,and display the value in the corresponding text boxes ... failllll.

on load event only the first value will returned in the textbox that display the entity, ie: 1 i couldnot get the rest of the entities.



sorrry i clicked reply rather than save .
Apr 4 '11 #2
Lysander
344 Expert 100+
I managed to do this using a crosstab query.

I created a test table with your fields and then wrote the following SQL
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum([rate]*[qty]) AS Expr1
  2. SELECT TEST.entity
  3. FROM TEST
  4. GROUP BY TEST.entity
  5. ORDER BY TEST.Name DESC 
  6. PIVOT TEST.Name;
  7.  
This gives an output of

entity Mark Kive Joe Ben
1 100 300 1100
2 200 400

You can base your report on the cross-tab query.
Apr 4 '11 #3
thank for the reply Lysander,you almost made my day .
i just selected test.name so i got the following:
which made no difference, just changed the look of the result
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum([rate]*[qty]) AS Expr1 
  2. SELECT TEST.name
  3. FROM TEST 
  4. GROUP BY TEST.name
  5. ORDER BY TEST.Name DESC  
  6. PIVOT TEST.entity; 
  7.  
  8. What i got as a result is :
  9. ==========================
  10. Names   | 1   |   2
  11. =========================
  12. MARK
  13. KIVE
  14. JOE
  15. BEN
  16.  
That was perfect, but i couldnt get the sum of each coloumn as a total ie. under 1 i need a total number wich sums up all the ones and at the end of each row also the total ie: total for mark.

I tried puting a text at end of each record /row of value
Expand|Select|Wrap|Line Numbers
  1.  =SUM([1]+[2]) 
  2. also =[1]+[2]
  3.  
,

seems giving the total of all the the values under thos 2 coulomns not , all the values per row.

Same trial to get the total for per each colomn, of value
Expand|Select|Wrap|Line Numbers
  1.  =SUM([1]) 
  2.  
,
the value showing on running the report is Error ,
any idea how to deal with it
????????
Apr 5 '11 #4
Solved the total per each colomn , i shoulda place the textbox =SUM([1]) in the Report Footer Section not in the Page footer , my mistake .

But still need the total per row ... cant figure out how .... any ideas are welcomed :)
Apr 5 '11 #5
Lysander
344 Expert 100+
I have deleted the table I made, so can't test this, but this code should give you the total per row.
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum([rate]*[qty]) AS Expr1 
  2. SELECT TEST.name, Sum([rate]*[qty]) AS [Total]
  3. FROM TEST 
  4. GROUP BY TEST.name
  5. ORDER BY TEST.Name DESC  
  6. PIVOT TEST.entity; 
  7.  
Apr 5 '11 #6
Thanks a lot, you really made my DAYYYY.

Appriciate your follow up ..
Apr 5 '11 #7
Lysander
344 Expert 100+
You're welcome. I find crosstab queries confusing and the crosstab query wizard is one of the few wizards I actually use. If you have not come across it, it is the third option when you go to create a new query. "Crosstab query wizard"
Makes this sort of thing a lot easier:)
Apr 5 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Wayne | last post by:
I've been having a click around Access 2007 this afternoon and have discovered some things that range from annoying to alarming. My Access 2003 menu bars, which I, like many others, use...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
5
by: Hollywood | last post by:
Good day dear members of the comp.databases.ms-access newsgroup. Please I need your help on the following. I'm the administrator of an Access 2007 database. I would like my enterprise personnel...
5
by: LadyIlsebet | last post by:
I'm not a fantastic Access developer, but I'm trying to help get Inventory and whatnot organized at work. They are used to 5 year budget plans that list out exactly what has to be purchased what...
4
by: robtyketto | last post by:
Greetings, I originally used a button on a from created via the button wizard (access 2007) to run my report which was based on a query. Since I wanted to add some validation I removed the...
1
by: ttfitz | last post by:
I have an application developed in Access 2000, to be distributed as an MDE. For those folks without Access, they install the free Access 2007 runtime. For the most part, this seems to be working...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
6
by: lyle fairfield | last post by:
ZoomControl is a hidden property of reports. Setting it to zero, makes the report fit the window. The default view of a report created in Access 2007 seems to be Report View rather than the...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.