By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,576 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

complex query question

P: n/a
hello,
i dont know if what i want to do is really considered complex, but i
sure cannot figure it out.
i need to create a query that shows the payments a person makes every
day for a variable date range.
for THIS example the date range is 5/1/2004 - 5/4/2004 (day1-day4)

The original table has 3 feilds :ID, DATE, PAYMENT

ID\ DATE \ PAYMENT
-------------------
1 \ 5/1/2004\ $5.00
1 \ 5/2/2004\ $3.00
1 \ 5/3/2004\ $10.00
1 \ 5/4/2004\ $4.00
----------------------
2 \ 5/1/2004\ $3.00
2 \ 5/2/2004\ $2.00
2 \ 5/3/2004\ $11.00
2 \ 5/4/2004\ $7.00
----------------------
5 \ 5/1/2004\ $8.00
5 \ 5/2/2004\ $5.00
5 \ 5/3/2004\ $9.00
5 \ 5/4/2004\ $9.00

the query will show the payments the ID has made each day. for days:
5/1/2004 - 5/4/2004 (day1-day4)

ID \ DAY1 \ DAY2 \ DAY3 \ DAY4
-----------------------------------
1 \ $5.00\ $3.00\ $10.00\ $4.00
2 \ $3.00\ $2.00\ $11.00\ $7.00
5 \ $8.00\ $5.00\ $9.00 \ $9.00
How would you go about making such a query?
Any help would be highly appreciated
thanks
Gil
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Giloosh wrote:
hello,
i dont know if what i want to do is really considered complex, but i
sure cannot figure it out.
i need to create a query that shows the payments a person makes every
day for a variable date range.
for THIS example the date range is 5/1/2004 - 5/4/2004 (day1-day4)

The original table has 3 feilds :ID, DATE, PAYMENT

ID\ DATE \ PAYMENT
-------------------
1 \ 5/1/2004\ $5.00
1 \ 5/2/2004\ $3.00
1 \ 5/3/2004\ $10.00
1 \ 5/4/2004\ $4.00
----------------------
2 \ 5/1/2004\ $3.00
2 \ 5/2/2004\ $2.00
2 \ 5/3/2004\ $11.00
2 \ 5/4/2004\ $7.00
----------------------
5 \ 5/1/2004\ $8.00
5 \ 5/2/2004\ $5.00
5 \ 5/3/2004\ $9.00
5 \ 5/4/2004\ $9.00

the query will show the payments the ID has made each day. for days:
5/1/2004 - 5/4/2004 (day1-day4)

ID \ DAY1 \ DAY2 \ DAY3 \ DAY4
-----------------------------------
1 \ $5.00\ $3.00\ $10.00\ $4.00
2 \ $3.00\ $2.00\ $11.00\ $7.00
5 \ $8.00\ $5.00\ $9.00 \ $9.00
How would you go about making such a query?
Any help would be highly appreciated
thanks
Gil


The best way would be to make a cross tab query. You'll even have a
total column. Click Query/New/CrossTab (PivotTable). Follow the wizard
steps.

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.