Okay, so you want something like this:
Field1 Field2 Field3 Field4 Field5 Field6 Field7 Field8 Field9
1 0 -2 4 -1 6
-5 4
Count of fields in this record with a value of zero or greater = 5
Is this right? If your answer is Yes, then you could use the following query:
SELECT (IIf([Field1]>=0,1,0))+(IIf([Field2]>=0,1,0))
+(IIf([Field3]>=0,1,0))+(IIf([Field4]>=0,1,0))
+(IIf([Field5]>=0,1,0))+(IIf([Field6]>=0,1,0))
+(IIf([Field7]>=0,1,0))+(IIf([Field8]>=0,1,0))
+(IIf([Field9]>=0,1,0))+(IIf([Field10]>=0,1,0))
+(IIf([Field11]>=0,1,0))+(IIf([Field12]>=0,1,0))
+(IIf([Field13]>=0,1,0))+(IIf([Field14]>=0,1,0))
AS [Number Fields]
FROM TableName;
It's a little ugly, but not too bad. Basically, we are using a conditional
IF statement (IIF) to test whether the field is greater than or equal to
zero. If it is, return a 1 otherwise return a zero. We then add the results
together. If a particular field is null, then the IIF([FieldName]>=0 will
evaluate to null.
Tom Wickerath
Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________