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 / Queries / March 2008

Tip: Looking for answers? Try searching our database.

Grouping

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stefan - 26 Mar 2008 19:53 GMT
I have an external medical billing database I am linking to.

I am working with 3 tables   Deposit, Payment, Transaction

When creating a transaction (medical procedure for billing) a unique charge
entry# is created.

You post the payments through the deposit table (unique deposit#) which
stores them in the payment table.  There are typically payments for many
patients on the same check.

In the payment table a unique payment entry# is created.  In the payment
table there is also a charge entry# field for reference to the corresponding
charge entry#.

Each charge item(medical procedure) typically has an insurance payment a
discount or disallowed amount.

In the transaction table an entry of each these fields is also created.  So
there is a unique charge entry# and unique payment entry#.

So without being too confusing for every charge entry# in the transaction
table there can be many related payment entry# (payments, discounts etc....)

In my query I only want the charge entry# to appear 1 time but I am getting
the same charge entry# for each related payment entry#.  (So I will get the
same 2 charges if there is a payment and a discount.)

I tried to group by but this doesn't work since the fields are all in the
same transaction table.

I appreciate any Help!

Stefan
Chris - 26 Mar 2008 20:36 GMT
There is nothing wrong with including multiple fields from the same table in
a group by clause. Post back with the SQL from your query and someone can
take a look at it to see what might be causing the problem.

> I have an external medical billing database I am linking to.
>
[quoted text clipped - 30 lines]
>
> Stefan
Mark - 26 Mar 2008 20:38 GMT
Stefan,
I would need more information, but I think in your query you need to add
criteria that excludes past payments.
Signature

Mark N

> I have an external medical billing database I am linking to.
>
[quoted text clipped - 30 lines]
>
> Stefan
Mark - 26 Mar 2008 20:41 GMT
Also forgot to mention you probably would be better off with a unique
identifier for each payment, not one that is created every time a payment or
charge is made.
Signature

Mark N

> I have an external medical billing database I am linking to.
>
[quoted text clipped - 30 lines]
>
> Stefan
Stefan - 26 Mar 2008 21:02 GMT
Hope this helps.

I cannot change the unique ID's since I am only linking to another program
"Medisoft"

SELECT MWPAX.[Deposit ID], MWTRN.[Entry Number], MWPAX.[Payment Reference],
MWPAX.[Charge Reference], MWTRN.[Chart Number], MWPAX.[Payment Amount],
MWTRN.[Transaction Type], MWTRN.[Date From], MWTRN.[Procedure Code],
MWTRN.Amount, MWTRN.[Insurance 1 Amount Paid], MWTRN.[Insurance 2 Amount
Paid], MWTRN.[Adjustment Amount], [Amount]+[Insurance 1 Amount
Paid]+[Insurance 2 Amount Paid]+[Adjustment Amount] AS Due, MWTRN.[Claim
Number], MWPAT.[Last Name], MWPAT.[First Name]
FROM MWPAX INNER JOIN (MWTRN INNER JOIN MWPAT ON MWTRN.[Chart Number] =
MWPAT.[Chart Number]) ON MWPAX.[Charge Reference] = MWTRN.[Entry Number]
WHERE (((MWPAX.[Deposit ID])=18636) AND ((MWTRN.[Transaction Type]) Between
"A" And "H"));

> Also forgot to mention you probably would be better off with a unique
> identifier for each payment, not one that is created every time a payment or
[quoted text clipped - 34 lines]
> >
> > Stefan
Stefan - 26 Mar 2008 21:04 GMT
The first one didn't have the group by selected

SELECT MWPAX.[Deposit ID], MWTRN.[Entry Number], MWPAX.[Payment Reference],
MWPAX.[Charge Reference], MWTRN.[Chart Number], MWPAX.[Payment Amount],
MWTRN.[Date From], MWTRN.[Procedure Code], MWTRN.Amount, MWTRN.[Insurance 1
Amount Paid], MWTRN.[Insurance 2 Amount Paid], MWTRN.[Adjustment Amount],
[Amount]+[Insurance 1 Amount Paid]+[Insurance 2 Amount Paid]+[Adjustment
Amount] AS Due, MWTRN.[Claim Number], MWPAT.[Last Name], MWPAT.[First Name]
FROM MWPAX INNER JOIN (MWTRN INNER JOIN MWPAT ON MWTRN.[Chart Number] =
MWPAT.[Chart Number]) ON MWPAX.[Charge Reference] = MWTRN.[Entry Number]
WHERE (((MWTRN.[Transaction Type]) Between "A" And "H"))
GROUP BY MWPAX.[Deposit ID], MWTRN.[Entry Number], MWPAX.[Payment
Reference], MWPAX.[Charge Reference], MWTRN.[Chart Number], MWPAX.[Payment
Amount], MWTRN.[Date From], MWTRN.[Procedure Code], MWTRN.Amount,
MWTRN.[Insurance 1 Amount Paid], MWTRN.[Insurance 2 Amount Paid],
MWTRN.[Adjustment Amount], [Amount]+[Insurance 1 Amount Paid]+[Insurance 2
Amount Paid]+[Adjustment Amount], MWTRN.[Claim Number], MWPAT.[Last Name],
MWPAT.[First Name]
HAVING (((MWPAX.[Deposit ID])=18636));

> Also forgot to mention you probably would be better off with a unique
> identifier for each payment, not one that is created every time a payment or
[quoted text clipped - 34 lines]
> >
> > Stefan
 
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.