473,378 Members | 1,415 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,378 software developers and data experts.

ASp/SQl not selecting properly

347 100+
I have the following sql statement in my asp page
Expand|Select|Wrap|Line Numbers
  1. yaketyQuery="SELECT * FROM celebs INNER JOIN mp3 ON celebs.idnumber = mp3.celebid where (mp3.voicetypea or mp3.voicetypeb or mp3.voicetypec or mp3.voicetyped or mp3.voicetypee or mp3.voicetypef or mp3.voicetypeg or mp3.voicetypeh or mp3.voicetypei or mp3.voicetypej or mp3.voicetypek or mp3.voicetypel or mp3.voicetypem or mp3.voicetypen or mp3.voicetypeo = '" &voiceid& "') and celebs.idnumber =" &actorid& " order by mp3.orderno"
  2. Set yaketyRecordset=yaketyConnection.execute(yaketyQuery)
the problem i am having is that i am returning all mp3 files and not just the ones that have the voiceid selected in any of the fields

any ideas anyone
May 4 '11 #1

✓ answered by Rabbit

You can't do it that way, you need to specify the condition each time.
"mp3.voicetypen = '" &voiceid& "' or mp3.voicetypeo = '" &voiceid & "'"

Or, alternatively, you can use the IN operator.

1 1413
Rabbit
12,516 Expert Mod 8TB
You can't do it that way, you need to specify the condition each time.
"mp3.voicetypen = '" &voiceid& "' or mp3.voicetypeo = '" &voiceid & "'"

Or, alternatively, you can use the IN operator.
May 4 '11 #2

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

Similar topics

12
by: mpinsley | last post by:
We are a software company that provides Inventory & Procurement mangement to the hospitality industry. For the past twenty years we have been using Progress Software as both the development...
0
by: Punky | last post by:
Hi all, I've gotten a long way with my application, but now it's generating an error to which I know no response. I hope any of you can (and will) help me. Below is the code. It's a simple piece...
7
by: Rodney King | last post by:
Hi, I have developed an ASP page which dynamically displays a list of checkbox options based on a SQL statement. Here is my code: <div style="OVERFLOW:auto; Height: 150px"> <table> <% dim...
1
by: orekinbck | last post by:
Hi There I have a datagrid whose main purpose in life is to provide a nice way for users to make a single choice from a list. The grid is read only, single row select and has its data source as...
2
by: larry | last post by:
I am working on a DB for family data, and in this application the data spans variable amount of rows in multiple tables (one for the adults data, one for "family", one for the kids, another for...
5
by: megahurtz | last post by:
I need to put together an SQL statement and I can't think of how to make it work properly. The scenario is that I have news items in a database that have a launch time and can optionally have an...
2
by: megahurtz | last post by:
I need to put together an SQL statement and I can't think of how to make it work properly. The scenario is that I have news items in a database that have a launch time and can optionally have an...
3
by: mark.norgate | last post by:
Hi Another problem... My drop down is always defaulting to selecting the first item in the drop down, even though I've got code specifically to change it to a different item: Dim adapter...
0
by: Alex Fung | last post by:
When I use GotFree Cards (http://www.got-free-ecards.com) to send free e-cards, I come across a problem when selecting the future date for sending the card. The webpage uses javascript and the...
0
by: Alex Fung | last post by:
When I use GotFree Cards (http://www.got-free-ecards.com) to send free e-cards, I come across a problem when selecting the future date for sending the card. The webpage uses JavaScript and the...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.