If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
A very little problem!
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 |
#2
|
|||
|
|||
A very little problem!
NEVER use fields called "Name", "True", False", "Date", "OR" or
anything else Access sees as a reserved word. Call it "True1" or something. hanski wrote: 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 |
#3
|
|||
|
|||
A very little problem!
On 28 Aug 2006 02:15:15 -0700, "hanski"
wrote: 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] |
Thread Tools | |
Display Modes | |
|
|