• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

var

I need the notation for the following sql where the varTable is not the actutual table name , it is a variable from my programme it varies according to some conditions. Also strFlag is not the actual field, I ran this but gave an error.


DSql = "SELECT * FROM varTable WHERE strFlag like 'D'"

many thanks
0
abidr
Asked:
abidr
  • 4
  • 4
1 Solution
 
viktornetCommented:
you could try this :)

DSql = "SELECT * FROM varTable WHERE strFlag like " & D

..-=ViKtOr=-..
0
 
viktornetCommented:
opps, sorry....

i misinterpretted your question...

what types are varTable and strFlag??

i guess strFlag is simply a string, but what is Table? a string too??

you should be able to do something like this...

DSql = "SELECT * FROM "&varTable&" WHERE "&strFlag&" like 'D'"

-vik-

..-=ViKtOr=-..
0
 
abidrAuthor Commented:
that was quick, I've just posted it. so is D at the ent a variable or just letter "D" as I want???
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
abidrAuthor Commented:
I have tested that it do not work. d is "D" fixed value in the field. The table will not work as it is now because it is a varible as i said earlier
0
 
abidrAuthor Commented:
I tried that
DSql = "SELECT * FROM "&varTable&" WHERE "&strFlag&" like 'D'"

 it gives syntax err.
0
 
viktornetCommented:
ok, please tell me of what TYPES are varTable and strFlag.. e.g., are they strings?, variants?, please tell me....

..-=ViKtOr=-..
0
 
abidrAuthor Commented:
it ok my mistake, the last one you sent works
0
 
viktornetCommented:
hehe, great :)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now