how to put in sql code

  • Thread starter Thread starter HENDRY_del_FUEGO via AccessMonster.com
  • Start date Start date
H

HENDRY_del_FUEGO via AccessMonster.com

first of all many thanks to Klatuu who has already helped me a lot!!

I create my SQl code by means of some string concatenation. I do this so i
can use the values of my field to create my SQl code.

The problem is that some of these fields are double-populated

eg. field location contains England and Brazil.
My string creates "IIf(
![Location]" & [Location] & ",'OK', 'problem')"

how can i populated the field location so that it is SQl-code?

as =(Brazil or England) does not work
as =Brazil or = England does not work
as ..........

normal i would be Location = "Brazil" or Location = "England" but this i cant
create in my string that needs to be universal for as wel fields whith one
thing in as for more things in...

any suggestion?
 
found it!!

FYI

I just need to use IN

![field] IN ("England" , "Brazil")

or NOT IN



HENDRY_del_FUEGO said:
first of all many thanks to Klatuu who has already helped me a lot!!

I create my SQl code by means of some string concatenation. I do this so i
can use the values of my field to create my SQl code.

The problem is that some of these fields are double-populated

eg. field location contains England and Brazil.
My string creates "IIf(
![Location]" & [Location] & ",'OK', 'problem')"

how can i populated the field location so that it is SQl-code?

as =(Brazil or England) does not work
as =Brazil or = England does not work
as ..........

normal i would be Location = "Brazil" or Location = "England" but this i cant
create in my string that needs to be universal for as wel fields whith one
thing in as for more things in...

any suggestion?
 
Sorry, I am a bit lost with your explanation.

Perhaps you want to use something along the lines of the following when
you are building the SQL string
" Location LIKE ""*" & [Location] & "*"" "
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top