Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

Help!! Combine two identical columns in a table.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AccessFitz - 07 Sep 2005 01:14 GMT
Hi,

I have two combo boxes in a table.  Method of Payments and Method of
Payments #2.  These combo boxes have the following options "Check", "Wire",
"Adjustment", and "CC."

Example:  1. Method of Payment = Check and Method of Payment #2 = Adjustment.
               2. Method of Payment = Adjustment.

Is it possible on a form or report to pull identical payments in the same
column?  So if I had a column called Adjustments in the form or report, that
the Method of Payment Amount and Method of Payment #2 Amount would pull under
one column?

I hope that makes sense.

Thanks
AccessFitz
Alex Dybenko - 07 Sep 2005 08:00 GMT
Hi,
i think you can first make a union query in order to put 2 columns in one,
and then use a cross-tab query with fixed columns

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Hi,
>
[quoted text clipped - 18 lines]
> Thanks
> AccessFitz
AccessFitz - 07 Sep 2005 16:47 GMT
Alex,

Thanks for your response.  What would the code look like?

> Hi,
> i think you can first make a union query in order to put 2 columns in one,
[quoted text clipped - 22 lines]
> > Thanks
> > AccessFitz
Alex Dybenko - 07 Sep 2005 21:25 GMT
Hi,
so if you have a table:
 Payment PID Person Amount Payment1 Payment2
     1 Alex 1 Check
   
     2 John 2 Adjustment Check
     3 Tim 3 Cash Check
     4 Mark 4 Adjustment Cash

then you make a query qPayment:
SELECT Payment.Person, Payment.Amount, Payment.Payment1 AS Payment
FROM Payment
UNION ALL SELECT Payment.Person, Payment.Amount, Payment.Payment2 AS Payment
FROM Payment;

and then one more:
TRANSFORM Sum(qPayment.Amount) AS SumOfAmount
SELECT qPayment.Person
FROM qPayment
GROUP BY qPayment.Person
PIVOT qPayment.Payment;

result will be:
 Query2 Person <> Adjustment Cash Check
     Alex 1
   
    1
     John
    2
    2
     Mark
    4 4
   
     Tim
   
    3 3

at least this is how i understand you

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Alex,
>
[quoted text clipped - 26 lines]
>> > Thanks
>> > AccessFitz
AccessFitz - 08 Sep 2005 22:26 GMT
Alex,

Thank You.  Worked like a Charm...

AcessFitz

> Hi,
> so if you have a table:
[quoted text clipped - 65 lines]
> >> > Thanks
> >> > AccessFitz
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.