473,663 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASp/SQl not selecting properly

347 Contributor
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
1 1419
Rabbit
12,516 Recognized Expert Moderator MVP
You can't do it that way, you need to specify the condition each time.
"mp3.voicet ypen = '" &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
1879
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 language and the underlying database. We are in the process of exploring new languages to write our application in, as Progress is becoming expensive for us. Here are some of our issues 1. Progress is a 4GL language so it is very rapid development....
0
4559
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 of code which should select a flexible range (one column wide) on one worksheet and copy it to another. Where things go wrong is in the last part of the code, for some reason the range is not selected properly. I've tried adding quotation marks...
7
1868
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 adOpenForwardOnly, adLockReadOnly dim adCmdTable, ctr, checkboxID
1
1884
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 an ArrayList. I came up against the issue of selecting a cell and getting the whole row to highlight, and the second issue of unhighlighting any previously selected row. To get around these two issues I have put in a two prong approach:
2
1976
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 employment schedule, and another for businesses, etc.). I was thinking on selecting the entire family (IDs of all the related records) and storing them in a session array for easy access (from script to script) as I edit the data, but am wondering...
5
2884
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 expire time set. I want to select all records that are above the launch time and below their expire time (if it is set). What I have so far is: $rightnow = mktime(); SELECT * FROM teamshadow_news WHERE (launch_time <= $rightnow AND expire_time =...
2
1379
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 expire time set. I want to select all records that are above the launch time and below their expire time (if it is set). What I have so far is: $rightnow = mktime(); sql = "SELECT * FROM teamshadow_news WHERE (launch_time <= $rightnow AND...
3
1233
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 As SqlDataAdapter = New SqlDataAdapter("SELECT appId, appName FROM application WHERE segmentID
0
1439
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 date for sending the e-card can be chosen by the user in a drop-down selection list. However, the month of date cannot not be displayed properly (i.e. showing 24-???-2010). I am using Window XP Professional SP3 and the problem still persists after I...
0
1181
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 date for sending the e-card can be chosen by the user in a drop-down selection list. However, the month of date cannot not be displayed properly (i.e. showing 24-???-2010). I am using Window XP Professional SP3 and the problem still persists after I...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.