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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top