V
veerleverbr
I have an Access database with 2 tables: [Product List Belgium] and
[Selection Fields]
The column [Product List Belgium].Tar is of the type Number
The columns [Selection Fields].Field and [Selection Fields].Value are
of the type Text
The following two queries run without errors:
select p.*
from [Product List Belgium] p, [Selection Fields] f1
where (p.[Tar] = Val(f1.Value) and f1.Field = 'Tar')
select p.*
from [Product List Belgium] p, [Selection Fields] f1
where (p.[Tar] is null and f1.Field = 'Dummy')
But when I combine the where clauses with an or like this:
select p.*
from [Product List Belgium] p, [Selection Fields] f1
where ((p.[Tar] is null and f1.Field = 'Dummy') or (p.[Tar] =
Val(f1.Value) and f1.Field = 'Tar'))
Then I get an error:
"Data type mismatch in criteria expression"
Any ideas what might be causing this?
Veerle
[Selection Fields]
The column [Product List Belgium].Tar is of the type Number
The columns [Selection Fields].Field and [Selection Fields].Value are
of the type Text
The following two queries run without errors:
select p.*
from [Product List Belgium] p, [Selection Fields] f1
where (p.[Tar] = Val(f1.Value) and f1.Field = 'Tar')
select p.*
from [Product List Belgium] p, [Selection Fields] f1
where (p.[Tar] is null and f1.Field = 'Dummy')
But when I combine the where clauses with an or like this:
select p.*
from [Product List Belgium] p, [Selection Fields] f1
where ((p.[Tar] is null and f1.Field = 'Dummy') or (p.[Tar] =
Val(f1.Value) and f1.Field = 'Tar'))
Then I get an error:
"Data type mismatch in criteria expression"
Any ideas what might be causing this?
Veerle