Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can this even be done? - Sorting Query Results a Strange Way 1

Status
Not open for further replies.

JPeters

MIS
Jul 25, 2001
423
US
Fellow Access Geniuses,
I've got a small problem. We've designed this matrix database ... in a form you enter data such as policy type, begin date, end date, among others... Then we run a query that pulls up only those records (duh a normal query) .. here's what Management wants done.
You see this query is ran on a monthly basis. Then the manager who runs it pastes the results into excell, plays with it, (don't ask me why he uses Excel... he likes it) finds out what he needs to know, and then he runs an append query in a DIFFERENT database taking the excel file and importing it into the new db.
The problem we are running in to is that the query we run on the first database (policy type, begindate, enddate, etc) pulls up ALL the records from forever's past. Since this is ran monthly.. In July I'll see records A1-A12.
During the Month in between the query's running, multiple users will enter new records into the a database that the query links to.
When I run it again in August I see A1-A13, A13 being a newly added record (bear in mind that there are thousands of records, not just a simple 13). Management doesn't want to see A1-A12. They only want A13 to show up when they run the August query.
So to put it simply, they don't want to see records that they have previously seen in this query. In July they want to see records that hadn't been displayed from the June running. In August they want to see records that weren't shown in July... and so on. Or they want the NEW records to be highlighted somehow, or made to stand out.
It baffles me and I'm not sure that this can be done without writing some sort of module (which I don't have a clue how to do). They want me to run a query and then tell that query to sort their First results by whether or not the records have been displayed before in the query.
There isn't a date field that I can sort by, unfortunately. Or I'd have this done by now. And I can't go back and enter a date field because all of those previous thousands of records don't have date fields (some people just don't plan ahead - doh!).
So tell me folks, what can I do. Thanks ;-)

-Josh
Wasting more of your valuable time...
 
How about adding a boolean that indicates a new record. You could make the default true. Then after every month's run of the reports, set the boolean on all records to false. Just select only true in your query/report.
 
Can you explain how to do that? I'm sure that would work.. Thanks a ton.

-Josh
 
Go into design table and add a field named something appropriate like current_month_record, set the type as yes/no, type Yes into the default value under the general table. Now any new records will have a value of "yes" or true in the field current_month_record. Existing records will have a value of "no".

Let the user do their normal updates. Change your query to add the field current_month_record and set the criteria as yes. The report will now only have new records.

Create a query that updates the field current_month_record to No for all records. Run this query after the reports have been produced and the user(s)are done.

Let the users enter the new records (their default will be yes) and they will be reported the next time you run your reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top