A very little problem!

  • Thread starter Thread starter hanski
  • Start date Start date
H

hanski

Hi

I have in my Access one row in sql language.

"select * from Dbase1, Dbase2 where Dbase2.Fieldname = true"

I would field called Name both in Dbase1 and Dbase2. In Dbase2 I have
in Fieldname field either true (-1) or false(0). In case Fieldname =
true I would like to involve such fields into my query from Dbase1. The
problem is that it gives me error "Invalid column name 'true' ".
How can I change my code, so it would acceptable?

Hannu
 
NEVER use fields called "Name", "True", False", "Date", "OR" or
anything else Access sees as a reserved word. Call it "True1" or
something.
 
Hi

I have in my Access one row in sql language.

"select * from Dbase1, Dbase2 where Dbase2.Fieldname = true"

Since you don't have any JOIN expression in this query, you will
retrieve every record in DBase1, paired with every record in DBase2
which fits the criterion. Probably not what you want!
I would field called Name both in Dbase1 and Dbase2.

As ManningFan says, this is a Bad Idea. I don't think it's causing
this particular problem but it might.
In Dbase2 I have
in Fieldname field either true (-1) or false(0). In case Fieldname =
true I would like to involve such fields into my query from Dbase1. The
problem is that it gives me error "Invalid column name 'true' ".
How can I change my code, so it would acceptable?

Please copy and paste the *actual* SQL of the query, or the context of
the VBA code in which you're setting up the query. I cannot see how
the SQL statement above would generate this particular error. It might
help to also know the field definitions, Primary Key, and
relationships between your tables.

John W. Vinson[MVP]
 
Back
Top