473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

dynamic "where"

102 100+
[PHP]select * from cbomnew where (comCode= 'PCEC'or comCode='L0X'or comCode='CCEC') [/PHP]

expert please help me on this...
the comCode after WHERE statement are static(hardcoded).. PCEC,L0X,CCEC ...

what should i do if i allow user to add a new comCode????

how do i define ??
after i add a new comCode.. it will store into the database..so

qryselect= "select comCode from table where comCode='???'" because i do not know what the user is going to key in there..
dim A
where (comCode= 'PCEC'or comCode='L0X'or comCode='CCEC' or comCode='A')
help.. thanksssss
Jul 2 '07 #1
1 1281
jhardman
3,406 Expert 2GB
help.. thanksssss
Just remember that the query is just made like any string, so you could say, for example:
Expand|Select|Wrap|Line Numbers
  1. qryselect = "SELECT comCode FROM table WHERE comCode = '"
  2. qryselect = qryselect & request.form("comCode") & "'"
your welcomesssssss

Jared
Jul 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: LRW | last post by:
I'm not exactly sure how to even ask the question, and I know my terminology is not good as I'm a SQL beginner, but, here goes. I need to find a way to make an if statement within an array...or,...
2
by: ITM | last post by:
Does anyone have an example of an SQL query which returns rows for the year-to-date, but where the "year" commences on August 1st? e.g. select * from mytable where datefield > last august 1st ...
2
by: Ellen Manning | last post by:
Using A2K. In my table I have the field "Grant" which can have a value or be null. I have a query that counts the number of records and has a Where clause on the Grant field. The query won't...
13
by: andro | last post by:
Hi everybody! I have several tables from which I want to exract the SAME value (along with other referenced data). All the values are in the same column within the tables. How can I achieve...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.