How to update different fields in a table using data from one colu

A

Akilah

I have a table with the column payment status. I want to extract specific
values from that column and place them in different columns in another table.
For example.

Table1 : ID PAYMENT

1 accepted
2 denied
3 pending


Table2: COUNTofAccepted COUNTofDenied COUNTofPending

1 1
1


Thanks
 
M

Michel Walsh

Hi,



Sounds a job for a (degenerated) crosstab:


TRANSFORM COUNT(*)
SELECT "all"
FROM table1
GROUP BY "all"
PIVOT payment



Generally, we have more than one "group" in the result, but here, it seems
we want just one row. To supply something, I elect to use "all" (as in "for
all the table").


Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top