View Full Version : Access - Report Filtering


Triel
07-21-2008, 09:08 PM
Hi all, I am new to the forum. I am having a hard time with this report they want me to do. I am thinking it is not possible with the fields in the database they created.

The report is to print out all new users to the system for that particular month. I know how to filter out and get just the month users but this does not guarantee they are "new" users.

The fields in the database are: "studentId" (key- silly text), First Name, Last Name, Date of Service, Hours used service, service used.

I am thinking there needs to be another date field where the date of first use is entered. Or am I all wet and there is another way?

hmm actually maybe you can do it. I guess maybe you could do a query pulling all the records for the month, then run another query that ties the 2 two together and filter out some how any records that have records for another month?

Seems a bit complicated though. Ideas? Code?

Any help would be appreciated. Thx for your time!

pbaldy
07-21-2008, 09:16 PM
Hint: a totals query grouping by studentID and Min date of service gets you the first date of use for each person.

georgedwilkinson
07-21-2008, 09:27 PM
I guess you could create a new table (or a new field in the current table) and run an insert (or update) query like this:
insert into MyNewTable (StudentID, FirstSeenDate)
select studentId, Date from MyOldTable where studentId not in (select StudentID from MyNewTable);

If you add a new field:
update MyOldTable set FirstSeenDate = Date where FirstSeenDate is null;

You could set up one or the other on an invisible form's timer event. Or create a whole new FE linked to your BE with a visible form, using its timer event.

This is air code, I haven't tested it and it is totally off the top of my head, but it should give you an idea or two how to proceed.

georgedwilkinson
07-21-2008, 09:29 PM
Man, I was thinking each row was unique to a student...if it is just a log, which appears to be true upon further reflection, go with Paul's recommendation and ignore mine.

Triel
07-22-2008, 02:42 PM
Thanks for your help. I did wind up doing a summary with selecting "first" on the date and then selecting greater than a date. After I got it working he tells me everyone is "new" in January. Not sure how they figure it but going to have to figure something out.

Thanks for your help! Much appreciated! :D