Hello:
I am a moderately capable Access user, however I am self-taught, so there are some holes in my knowledge which have a tendency to be filled when I run into a problem. Like now...
I have a table in which I want to present in a report the lowest number of three fields. These fields are entered or calculated within the table and/or query, or may be empty of data. They are as follows:
RawStrawConc
PreFreezeConc
PostThawConc
In what is probably an inelegant manner, I perform the sort to produce a final value (called "UseCount") by breaking the items into different calculations:
PreFreezeCount: IIf(Not IsNull([RawStrawConc])<Not IsNull([PreFreezeConc]),[RawStrawConc],[PreFreezeConc])
PostThawCount: IIf([PostThawConc] Is Null,1,[PostThawConc])
UseCount: IIf(([PostThawCount]>1<[PreFreezeCount]),[PreFreezeCount],[PostThawConc])
As can be seen, the first calculation is intended to present the lowest of RawStrawConc or PreFreezeConc, if neither is an empty value. This creates a value called "PreFreezeCount" which is then used in the last calculation.
The second calculation is intended to create another value for use in the last calculation "PostThawCount" and will give an empty (Null) field in "PostThawConc" a value of 1.
The last calculation is intended to compare PostThawCount and PreFreezeCount and return the lowest value, while excluding a PostThawConc which has no entry (and has therefore been given a value of 1).
The annoying and puzzling thing is that it seems to work some of the time, so I am at a loss as to what it is which is messing up.
This is what is returned in one query and I have highlighted the aberrations - which seem to have no regularity... Perhaps there is a more elegant and effective way of achieving this? I am sure there is and hope someone might be able to assist me with it!!
(Apparently I cannot display links or images until I have been present on the board longer - not unreasonable! - so I don't know if my uploaded image will be saved or not, but if it is, it was loaded at "access-programmers.co.uk/forums/attachment.php?attachmentid=59580" with the http and www prefixes of course).
I am a moderately capable Access user, however I am self-taught, so there are some holes in my knowledge which have a tendency to be filled when I run into a problem. Like now...

I have a table in which I want to present in a report the lowest number of three fields. These fields are entered or calculated within the table and/or query, or may be empty of data. They are as follows:
RawStrawConc
PreFreezeConc
PostThawConc
In what is probably an inelegant manner, I perform the sort to produce a final value (called "UseCount") by breaking the items into different calculations:
PreFreezeCount: IIf(Not IsNull([RawStrawConc])<Not IsNull([PreFreezeConc]),[RawStrawConc],[PreFreezeConc])
PostThawCount: IIf([PostThawConc] Is Null,1,[PostThawConc])
UseCount: IIf(([PostThawCount]>1<[PreFreezeCount]),[PreFreezeCount],[PostThawConc])
As can be seen, the first calculation is intended to present the lowest of RawStrawConc or PreFreezeConc, if neither is an empty value. This creates a value called "PreFreezeCount" which is then used in the last calculation.
The second calculation is intended to create another value for use in the last calculation "PostThawCount" and will give an empty (Null) field in "PostThawConc" a value of 1.
The last calculation is intended to compare PostThawCount and PreFreezeCount and return the lowest value, while excluding a PostThawConc which has no entry (and has therefore been given a value of 1).
The annoying and puzzling thing is that it seems to work some of the time, so I am at a loss as to what it is which is messing up.
This is what is returned in one query and I have highlighted the aberrations - which seem to have no regularity... Perhaps there is a more elegant and effective way of achieving this? I am sure there is and hope someone might be able to assist me with it!!
(Apparently I cannot display links or images until I have been present on the board longer - not unreasonable! - so I don't know if my uploaded image will be saved or not, but if it is, it was loaded at "access-programmers.co.uk/forums/attachment.php?attachmentid=59580" with the http and www prefixes of course).