Field sometimes in the report

new_2_prog

Registered User.
Local time
Today, 15:09
Joined
Aug 4, 2008
Messages
58
In my underlying query I have a field "Elec" that sometimes is populated and shows up in the query and sometimes its not and doesn't show up in the query. Obviously if its not there my report won't open because it's looking for that field and doesn't see it, how do I account for this?

Is there something I need to do with the query or something I can do in the report? I tried in the report =iif([Elec] is null, 0, [Elec]) but that didn't work.

Thanks.
 
Regardless of whether the field is populated or not, if it is in the select statement of the query that field will be in the query. So I don't understand what you mean by it shows up and it doesn't. It will show up regardless but it may be null. So you can use the thing you almost had right (and I would use it in the query and then set the report's text box to use that new field you create):

iElec:IIf(IsNull([Elec]), 0, [Elec])
 
Sorry, it's a crosstab query and that is one of the many downtime codes and depending on the day chosen for the query that could be a reason, another or even none.

I think I have to somehow force it to always be in the query.

Btw, the code didn't work in the query or the table.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom