Field does not exist - any useful functions?

EIS

New member
Local time
Today, 22:40
Joined
Aug 6, 2007
Messages
2
I need a function or way of dealing with a field that may or may not exist.

I am crosstabbing a large database and then building queries on the crosstab. However, the field from which the column headings come does not always have the same data in it as I have to cut the data in different ways (always similar but not always the same). As a result, sometimes I get the error message:

"The Microsoft Jet Engine doesnot recognise [FIELD] as a valid field name or expression"

where a field I was expecting did not appear.

If it was a null value within a field I remove it like this:
iif([Field] is null, 0, [Field])

Is there an equivalent formula for "exists" that will stop my queries falling over when it cannot find the field?
eg iif(exists([Field]),[Field],0)

Any help, guidance or assistance gratefully received!
 
In the SQL statement of the crosstab query, you can list the column headings with the IN operator after the PIVOT clause e.g.

TRANSFORM ............
SELECT ............
FROM ............
GROUP BY ............
PIVOT [District] IN ("Eastern Market","North Point","Central","Southern End");
.
 
Thanks!

Jon you are a superstar!

Thanks ever so much!
 

Users who are viewing this thread

Back
Top Bottom