Hi everyone,
I have a table with a set of accounts in that contains one row for each
account for each time it has been audited. (this may not include every
account we deal with)
Each month I want to select, from a separate and full list of accounts
that i import to the database, a random selection of new accounts to be
audited this month. Hence, a row for each one needs to be added to the
original database and the most recent entry updated (if it has been
audited before).
I don't want to select an account for re-audit within 3 months (for
example) and the accounts have a category. I want the sample selection
to be variable for each category i.e. 12 account of type A, 25 accounts
of type B etc.
I'm currently doing this with query upon query upon query (about 16 at
the moment) and can't help thinking that there must be a more logical
way of doing this in code or maybe by using more effective queries...
I'm looking for advice on the approach i should take not really looking
for code samples but will take advice on that if it is provided.
Any good ideas out there?
Thanks,
Rob.