Connecting Tech Pros Worldwide Forums | Help | Site Map

grouping in reports

spirytuspl@hotmail.com
Guest
 
Posts: n/a
#1: Nov 13 '05
i got problem with creating reports and would appreciate if someone
would point me out to some good tutorials on the topic, or simply
explain where should i start and what should i do.. i'm quite in hurry
and having checked the net i'm still stuck so you guys are my only hope
;) lets say i'm having on only one table with four columns:

date sid payment agent
11/02/2003 1234 500 abc
... ... ... ..

and so on..

my report has to look sth. like that:

sid january february march april ......
1234 800 300 700 1000


so every person with "sid" i paying certain amount and those payments
are stored in database, every one o them with unique date. on report i
need to display sid number, and how much that particular person with
sid had paid in each month (dosent matter what year). i'm sorry if
explanation is not very clear but i did the best i could, if any more
information will be necessary please let me know and i'll try to
clarify my problem. thank you very much for any help as such would be
MUCH appreciated :)


MGFoster
Guest
 
Posts: n/a
#2: Nov 13 '05

re: grouping in reports


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Use a cross-tab query as the report's data source. Create the report
based on the query (IOW, create the query first).

Query:

TRANSFORM Sum(payment) As theValue;
SELECT sid, Sum(Payment) As Total
FROM table_name
GROUP BY sid
PIVOT Format([date], "mmm") IN ("Jan", "Feb", "Mar", "Apr", "May",
"Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")

I used the IN () subclause so you'd always have the month names - just
in case there aren't any payments for one, or more, months.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQcE/VoechKqOuFEgEQIiYQCdHi6uyrIPJhaFsvF4S3E+9QSOTtcAoL E+
5aR1GOcKvpDNHmBq7y1x5QBq
=A2rU
-----END PGP SIGNATURE-----


spirytuspl@hotmail.com wrote:[color=blue]
> i got problem with creating reports and would appreciate if someone
> would point me out to some good tutorials on the topic, or simply
> explain where should i start and what should i do.. i'm quite in hurry
> and having checked the net i'm still stuck so you guys are my only hope
> ;) lets say i'm having on only one table with four columns:
>
> date sid payment agent
> 11/02/2003 1234 500 abc
> .. ... ... ..
>
> and so on..
>
> my report has to look sth. like that:
>
> sid january february march april ......
> 1234 800 300 700 1000
>
>
> so every person with "sid" i paying certain amount and those payments
> are stored in database, every one o them with unique date. on report i
> need to display sid number, and how much that particular person with
> sid had paid in each month (dosent matter what year). i'm sorry if
> explanation is not very clear but i did the best i could, if any more
> information will be necessary please let me know and i'll try to
> clarify my problem. thank you very much for any help as such would be
> MUCH appreciated :)
>[/color]
spirytuspl@hotmail.com
Guest
 
Posts: n/a
#3: Nov 13 '05

re: grouping in reports


thank you very much :) query works perfectly in "queries" but somehow
couldnt get it working in "reports" cause getting error saying that
query contains syntax error or function is not available in Access. it
also says that if syntax is ok i should go into registry, do some
changes and then reinstall acces, but you reckon it might be the case?
i had office xp installed before, than i uninstalled it and without
restarting (very clever of me ;) i installed office 2000 so maybe
registry got messed up and thats the reason why it gives me problems
even with query you provided. anyway once again thank you very much for
your help, i really appreciate it

Closed Thread