Formula

Well, still can't get the 'round up' on odd plus result but NOT on negative results.
This is what I have laborously come up with that works for everything else. Only way I could figure was to use different expressions. Can't figure how to put them together, which isn't necessary anyway.
* The "odd" statement does not add to any result. If I use "even", it adds to all.
* Then the other problem is if frineed and fripull are the same, I get an error as result.

SELECT tblpoints.frineed, tblpoints.fripull,
IIf([fripull]<[frineed],[frineed]-Int(([frineed]-[fripull])/2),IIf([fripull]>[frineed],[frineed]+Int(([fripull]-[frineed])/2),[fripull])) AS satneed,
Switch([fripull]<[frineed],[frineed]-Int(([frineed]-[fripull])/2),[fripull]>[frineed],[frineed]+Int(([fripull]-[frineed])/2),True,[fripull]) AS Satneed2,
IIf([satneed]="odd",Int([satneed]+1),[satneed]) AS rndup,
IIf(Int([fripull]-[frineed])>3,4,Int(([fripull]-[frineed]))) AS restrictup,
IIf([restrictup]<-3,-4,[restrictup]) AS restrictdwn
FROM tblpoints;
 
Last edited:

Users who are viewing this thread

Back
Top Bottom