A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

report in access (Count)



 
 
Thread Tools Display Modes
  #1  
Old May 29th, 2010, 04:06 PM posted to microsoft.public.access.reports
M.K[_2_]
external usenet poster
 
Posts: 12
Default report in access (Count)

If i have data in CSV file and it show like belwo

Column1 Column2
ABCD Saturday
ABCD Saturday
EFGH Sunday
ABCD Saturday
MMM Friday
ABCD Monday
EFGH Monday

I want report show like

Saturday Sunday Monday Tuesday Wednesday Thursday
Friday
ABCD 3 0 1 0 0
0 0
EFGH 0 1 1 0 0
0 0
MMM 0 1 1 0 0
0 1


BR
  #2  
Old May 29th, 2010, 05:19 PM posted to microsoft.public.access.reports
PieterLinden via AccessMonster.com
external usenet poster
 
Posts: 307
Default report in access (Count)

M.K wrote:
If i have data in CSV file and it show like belwo

Column1 Column2
ABCD Saturday
ABCD Saturday
EFGH Sunday
ABCD Saturday
MMM Friday
ABCD Monday
EFGH Monday

I want report show like

Saturday Sunday Monday Tuesday Wednesday Thursday
Friday
ABCD 3 0 1 0 0
0 0
EFGH 0 1 1 0 0
0 0
MMM 0 1 1 0 0
0 1

BR


You don't have enough columns for a crosstab, so you have to add a "fake" one.


first query (qXTBSrc)
SELECT GroupingDayOfWeek.Grouping, GroupingDayOfWeek.DayOfWeek, 1 AS MyCount
FROM GroupingDayOfWeek;

crosstab:
TRANSFORM Sum(qXTBSrc.MyCount) AS SumOfMyCount
SELECT qXTBSrc.Grouping, Sum(qXTBSrc.MyCount) AS [Total Of MyCount]
FROM qXTBSrc
GROUP BY qXTBSrc.Grouping
PIVOT qXTBSrc.DayOfWeek;

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/201005/1

  #3  
Old June 4th, 2010, 08:07 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default report in access (Count)

I would try:
TRANSFORM Val(Nz(Count(Column2),0)) as TheValue
SELECT Column1
FROM CSVFile
GROUP BY Column1
PIVOT Column2 IN
("Saturday","Sunday","Monday","Tuesday","Wednesday ","Thursday","Friday");

--
Duane Hookom
Microsoft Access MVP

NOTE: These public News Groups are ending June 1st. Consider asking
questions at http://social.answers.microsoft.com/...ddbuz/threads?


"PieterLinden via AccessMonster.com" wrote:

M.K wrote:
If i have data in CSV file and it show like belwo

Column1 Column2
ABCD Saturday
ABCD Saturday
EFGH Sunday
ABCD Saturday
MMM Friday
ABCD Monday
EFGH Monday

I want report show like

Saturday Sunday Monday Tuesday Wednesday Thursday
Friday
ABCD 3 0 1 0 0
0 0
EFGH 0 1 1 0 0
0 0
MMM 0 1 1 0 0
0 1

BR


You don't have enough columns for a crosstab, so you have to add a "fake" one.


first query (qXTBSrc)
SELECT GroupingDayOfWeek.Grouping, GroupingDayOfWeek.DayOfWeek, 1 AS MyCount
FROM GroupingDayOfWeek;

crosstab:
TRANSFORM Sum(qXTBSrc.MyCount) AS SumOfMyCount
SELECT qXTBSrc.Grouping, Sum(qXTBSrc.MyCount) AS [Total Of MyCount]
FROM qXTBSrc
GROUP BY qXTBSrc.Grouping
PIVOT qXTBSrc.DayOfWeek;

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/201005/1

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.