Senin, 05 Maret 2012

RE: [MS_AccessPros] Null Problems

 

I am having problems with a Null value.

I ran a crosstab query to calculate wins and losses of a team. Wins are
designated by a [1] in the field and losses by a [2]. The crosstab query
worked great, but I also want to calculate winning percentage like you see
when you look at baseball standings. The problems is that if a team has won
or lost all of their games the crosstab query returns an empty field. In
the next query that pulls values from my crosstab query I would like to
replace that Null values with a "0" so I can use the number for
calculations.

I tried this.

IIf([1] is Null,0,[1]) ..in the Criteria row of the query.

1 is the value that indicates a win, and is also the name of the field in
the crosstab query.

I start out with 17 records in my query. 3 of them have and emply [1]
field, which is the win column. When I insert the above IIf statement in
the CRITERIA row of the query, my query runs but is only shows 14 records.
The 3 records with the Null values in the win field do not show. I would
like all 17 records with "0" put in the Null [1] field for those teams that
have zero wins. How do I make that change?

IIf([2] is Null,0,[2]) is what I also want to do if a team has all wins
and no losses. The [2] field of the crosstab record records losses.

I am doing something wrong.

Thank you for your help.

Bill

MN

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar