Query pulling a column not existing in the table

bugsy

Registered User.
Local time
Today, 09:41
Joined
Oct 1, 2007
Messages
99
Is there a way to specify in the query sql, if column XX exists in a table, pull it, if doesn't exist, create a blank column "XX" ?
 
No I don't think its possible. You would have to check if the column exists and build your SQl dynamically.
 
No I don't think its possible. You would have to check if the column exists and build your SQl dynamically.

grim outlook...
is possible in Access ?
 
If you're looking for votes, I don't think it's possible with pure SQL either. You'd have to build it dynamically. I'm curious why you wouldn't know the fields existing in the table anyway, unless it's being imported or something. Often this type of question arises from a design flaw, where for example you have a field for each year or something along those lines.
 
Well, the situation is like this.
I am creating CROSSTAB query from a table that needs to be exported in the same format every day. Sometimes it has data in 0-2 age, sometimes doesn't.

Depending on that "0-2" column will, or will not exist.
I'd like it to always exist.

(perhaps somehow incorporate Dummy row, but that would be inconvenient)
 
THANKS !!!!!!
This is fantastic !!!!!
Exactly what I needed. I already utilized that.
:D:D:D:D
 

Users who are viewing this thread

Back
Top Bottom