If you have two queries against that table, one for "today's" and one for
"yesterday's", you can create a third query that uses the first two as their
"tables", do the subtraction, and test in the query for a difference greater
than 10%.
There would be multiple ways to do this test, so here's (only) one:
In the Field, calculate the ratio between Query1-Value and Query2-Value. In
the Selection Criterion beneath this new "field", put something like
(untested):
If you want to cover a CHANGE of 10% or more, put:
Does that get you closer?
Regards
Jeff Boyce
Microsoft Access MVP
--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.
Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.
You can thank the FTC of the USA for making this disclaimer
possible/necessary.
I am using Access 2003
The two text files are emailed to us Daily. (sample data below)
I’ve come to understand Jeff’s point that I only need one table.
In fact as I’ve explained to the requester of this process, I only
need to import TODAYS data as I will already have imported Yesterdays
data.
Makes total sense now.
To answer your question Bob, about aggregation;
Not in this example, BUT in another process, YES there will be
multiple records for the same account.
I’m guessing that I’ll use a Totals query with a GroupBy for that
process…
Sample Data Follows...
TalCash_Wed.txt
"H","TALACCASHD","TALCASH.WED","2010-06-09"," 41:57"," "
"A401611","CDN",95477.66,20100609
"A401835","CDN",28804.85,20100609
"A402353","CDN",27336.47,20100609
"0103200","CDN",105.47,20100609
"0103218","CDN",428.71,20100609
"0103234","USA",979.99,20100609
"0112292","CDN",5051.39,20100609
TalCash_Thu.txt
"H","TALACCASHD","TALCASH.THU","2010-06-10"," 1:07:55"," "
"A401611","CDN",95477.66,20100610
"A401835","CDN",28804.85,20100610
"A402353","CDN",27336.47,20100610
"0103200","CDN",105.47,20100610
"0103218","CDN",428.71,20100610
"0103234","USA",1080.79,20100610
"0112292","CDN",5051.39,20100610
So now I have ONE table with a DATE field. I’ve used an Import
Specification.
I understand how to find the records for Today and Yesterday using
Date() and Date()-1
I’m still confused as to how to find out if the difference between
Today and Yesterday is greater than 10% Plus or Minus.
And how convoluted is the code/logic going to be to compare Monday to
Friday, Never mind Holidays
I may have gotten in over my head on this one. :{