Judd123
02-05-2009, 07:37 AM
Hi,Im trying to make a database for a client and i am stuck on how to convert scores for a test to pass, merit etc to be viewed in a report, I thought it might have to be done by making a query then make a report from that query.Any help would be much appreciatedThanks
pbaldy
02-05-2009, 07:44 AM
Lots of ways, depending on your specifics. Options include IIf(), Switch(), Select/Case in VBA, and probably the most flexible, a table containing the ranges of values and their text equivalent.
I do something that sounds similar, to indicate if a branch has met it's sales targets.
I'd use something like the following to get the figures.
SELECT
SalesTotal,
Branch Name
FROM
SalesFigures;
Which could be adapted as follows to say "Achieved" or not, depending on whether the value was above or below a set mark.
SELECT
Iif(SalesTotal >= 500,000,"Achieved","Not Achieved") AS SalesStatus,
Branch Name
FROM
SalesFigures
If you wanted to alter it to have, say, >50% is "pass", >70% is "excellent", >90% is "distinction", you can use nested if statements. There's plenty on this on the forum (no doubt explained far better than I could).
Once you have your query, you can - as you said - create a report based on it.
Hope that helps.
Judd123
02-05-2009, 07:55 AM
Hi, thank you for the reply,If i used Switch () in VBA, what do i put in the brackets as the "ParamArray" would it be the "Cadre_Score" from my test scores table? bit vague i know.. sorryThanks.Chris
Judd123
02-05-2009, 07:58 AM
Thats Brilliant,Thank you very much for your timemuch appreciated.Chris