473,799 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selectively deleting records

I am researching the use of physician services that are recorded in a
billing database of over 10 million records. I am only interested in
the patient's treatment type, and their attributes (age and sex).
Simple enough, but the DB is used to record journal entries and
adjustments. If a patient gets recoded, then that is entered as a
separate record with a negative unit. Typically there are three
records:
patient# treatment# units
123 200 1
123 200 -1
123 201 1
This is really only one correct visit for treatment 201. If I just
delete units <0, then I get an incorrect unit for 200, and one correct
unit for 201. Need to mark and delete the first to entries. I can do it
by creating a table totals for negative units by treatment and subtract
from the totals for each treatment total, but I then I have all these
records that have to be excluded for unit level analysis. Would rather
just mark the two records and delete. There can be many records for one
individual for different codes, so it gets complicated pretty fast.
thanks, really need to get this done

Sep 5 '06 #1
2 1410
Would a simple GroupBy and SUM help you?

You can exclude UnitSums that are 0 if that suits you.

Something like:
SELECT YourTable.Patie nt, YourTable.treat ment, Sum(YourTable.U nit) AS Unit
FROM YourTable
GROUP BY YourTable.Patie nt, YourTable.treat ment
HAVING (((Sum(YourTabl e.Unit))<>0));

If this gives the needed results than change into a maketablequery and report on the new table

Or only use the GroupBy and Sum without the exclusion.
The Sum gives you the real number of treatments.
Report on the treatments where the sum is not 0...

Arno R
"johnds" <jo*******@yaho o.comschreef in bericht news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
>I am researching the use of physician services that are recorded in a
billing database of over 10 million records. I am only interested in
the patient's treatment type, and their attributes (age and sex).
Simple enough, but the DB is used to record journal entries and
adjustments. If a patient gets recoded, then that is entered as a
separate record with a negative unit. Typically there are three
records:
patient# treatment# units
123 200 1
123 200 -1
123 201 1
This is really only one correct visit for treatment 201. If I just
delete units <0, then I get an incorrect unit for 200, and one correct
unit for 201. Need to mark and delete the first to entries. I can do it
by creating a table totals for negative units by treatment and subtract
from the totals for each treatment total, but I then I have all these
records that have to be excluded for unit level analysis. Would rather
just mark the two records and delete. There can be many records for one
individual for different codes, so it gets complicated pretty fast.
thanks, really need to get this done
Sep 5 '06 #2
That makes perfect sense. I knew somewhere in the steps the individual
patient had to be grouped for each treatment, but had not thought of
the exclusion. I did not mention in my post that these entries are all
on the same day. But it should not matter if it happens in different
periods, as long as it is the same patient for the same treatment, the
total visits and units for the year will be correct regardless. I am
only looking at totals for the year. Also, your method will give me a
record that is one visit, so now I have number of visits by treatment,
and units provided.

thanks,
Arno R wrote:
Would a simple GroupBy and SUM help you?

You can exclude UnitSums that are 0 if that suits you.

Something like:
SELECT YourTable.Patie nt, YourTable.treat ment, Sum(YourTable.U nit) AS Unit
FROM YourTable
GROUP BY YourTable.Patie nt, YourTable.treat ment
HAVING (((Sum(YourTabl e.Unit))<>0));

If this gives the needed results than change into a maketablequery and report on the new table

Or only use the GroupBy and Sum without the exclusion.
The Sum gives you the real number of treatments.
Report on the treatments where the sum is not 0...

Arno R
"johnds" <jo*******@yaho o.comschreef in bericht news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
I am researching the use of physician services that are recorded in a
billing database of over 10 million records. I am only interested in
the patient's treatment type, and their attributes (age and sex).
Simple enough, but the DB is used to record journal entries and
adjustments. If a patient gets recoded, then that is entered as a
separate record with a negative unit. Typically there are three
records:
patient# treatment# units
123 200 1
123 200 -1
123 201 1
This is really only one correct visit for treatment 201. If I just
delete units <0, then I get an incorrect unit for 200, and one correct
unit for 201. Need to mark and delete the first to entries. I can do it
by creating a table totals for negative units by treatment and subtract
from the totals for each treatment total, but I then I have all these
records that have to be excluded for unit level analysis. Would rather
just mark the two records and delete. There can be many records for one
individual for different codes, so it gets complicated pretty fast.
thanks, really need to get this done
Sep 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6118
by: Mark | last post by:
This question refers to a main form with a continuous form subform. After an error occurs after entering several records in the subform, how can I delete all the data in the main form and all the records in the subform? I have tried undoing both the main form and the subform and I have tried deleting the record in the main form. Thanks! Mark
3
2757
by: Nathan Bloom | last post by:
Hi, I have a data entry form (access 2000) that also allows the user to add, update, and delete records from the form. The Delete action is carried out in an event procedure and has the following code: Private Sub Command28_Click() On Error GoTo Err_Command28_Click
2
1901
by: uv | last post by:
Hi! I'm having problems submitting a new record through the form. I'm working with the wizard and I've added a control button to my form for entering entering a new record but for some reason it only works for the first record I enter. The same goes for deleting a record. It says I can't access the records, and that goes for both making or deleting. I'd appreciate your help very much, uv
3
2002
by: Mike Turco | last post by:
I'm working on an application that imports and exports tons of CSV data, like 64,000 records per file, and six or seven files in a set. First off, by the tine I import a few hundred thousand records the database is _huge_. Like 500 meg, although the csv files are only 25 meg in total. When I compact the database its still 100meg. How do I keep the size down? Second, I did a manual delete of 300,000 records yesterday by doing a...
1
1890
by: Coy Howe | last post by:
This one seems bizarre! We have a database consisting of a main table and 12 - 15 "sub" tables, which are connected via cascading relationships. The database performs many complex calculations and displays the results in both forms and reports. In the process of developing the database we "entered" 12 sample clients. Before packaging the database we remove the sample clients by deleting them from the main table, which cascades the...
1
2397
by: KC | last post by:
Hello, I am using Access 2002. WinXP, Template from MS called Orders Mgmt DB. I have tweaked this DB to work for our small co. It has worked pretty well up until I made the mistake of deleting about 80 records from the Orders table. 80 out of a 1000 records. Now our data entry form shows our customer addresses, but not customer order history. When looking at all of the tables, customer, payments, orders, they still have all of the...
5
14742
by: Mojtaba Faridzad | last post by:
Hi, with SetDataBinding( ) a DataGrid shows a DataView. user can select some rows in the grid by holding cotrol key. when user clicks on Delete button, I should delete all selected rows. I am trying to delete these lines from the dataview like this: for (int i=0; i < dataView.Count; i++) if (dataGrid.IsSelected(i)) dataView.Delete(i);
11
3687
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night) and the 'employee name'. There is another table which assigns an ID to the Shifts, i.e. 1,2 and 3 for morn, eve & night shifts respectively. From the mother table, the incentive is calculated datewise for each employee as per his shift duty. In...
2
2116
by: padmaneha | last post by:
Hi I have created two tables 'TrainsMaster' & 'TransArrvlDepinfo' Columns which I have created in 'TrainsMaster' are 'trainName,TrainNo, StartStaionId, & EndstationId' Columns which I have created in ''TransArrvlDepinfo' are 'Stationcode, TrainNo, Arrvaltime,Depttime' I have to delete few trains from 'TrainsMaster' for which the Startstationid or Endstationid are nulls which comes to 50 records
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10249
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10219
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10025
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7563
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5461
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.