473,886 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieve data using multiple select

18 New Member
Hi everyone

Is is possible to retrieve data using multiple select. Here is my SQL code:

select sum(nPassengers ) Planned, Actual, (sum(Planned) - Actual) Variance
from (
select iDeptCode, sum(nPassengers ) Planned from tbl_BusRequest
where iReqTime = '1' and iDeptCode = '1' and cReqType = 'I'
group by iDeptCode
(Actual = (Select nPassengers from tbl_Riders_NonR iders where dtDate = '11/05/06'
AND cReqType = 'i' and iTimeCode = '1' and iDeptCode = '1' )

Nov 9 '06 #1
1 3457
143 New Member
i'm not sure your script will run as written. This is what I can come up with from your code:

select sum(nPassengers ) Planned, Actual, (sum(nPassenger s) - Actual) Variance from tbl_BusRequest
where iReqTime = '1' and iDeptCode = '1' and cReqType = 'I'

(Actual = (Select nPassengers from tbl_Riders_NonR iders where dtDate = '11/05/06'
AND cReqType = 'i' and iTimeCode = '1' and iDeptCode = '1' ))
Nov 9 '06 #2

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

Similar topics

by: Daniel Tonks | last post by:
First, please excuse the fact that I'm a complete MySQL newbie. My site used forum software that I wrote myself (in Perl) which, up until now, has used flat files. This worked fine, however lately I've been wanting to do more stuff with user accounts, and had been eying MySQL for over a year. Finally I've decided to start off small by converting the forum's account system to a MySQL database (and convert the rest later after I'm...
by: Adam | last post by:
I have extensively searched for a solution. Below is my code that is contained in an aspx. When my browser hits this aspx, I just get the standard broken image picture. I know the data is the database is correct because I have seen another employee retrieve it using Crystal Reports. Can someone please tell me what I am doing wrong and offer a suggestion to make this work? (This code does not generate errors, I just can't the image to...
by: Neil | last post by:
Hello everyone, I am making a program at the moment, and need HELP!!!. I'll start with the database, my field's r: fldSku - which a 6 digit number, no more no less (145682) fldDescription - which is the description of a clothing fldLabel - Which is the band name of the clothing and fldPrice. k, what i need to do is, when i search for a SKU (which might have duplicates) in the db, i want it to return it to a datagrid on the form, and plus...
by: jaYPee | last post by:
I have currently using a dataset to access my data from sql server 2000. The dataset contains 3 tables that is related to each other. parent/child/grandchild relationship. My problem is it's very slow to retrieve records from sql server. I'm using sqldataadapter.fill method to populate dataset. Parent table contains more than 3,000 records and child table contains more than 10,000 records and grandchild table contains more than 90,000...
by: ykong1214 | last post by:
In my project, there is a single select tag, <html:select property="userName" size="7"> <html:options collection="UserList" property="value" labelProperty="label" /> </html:select> <br><br> <input type="button" value="Select" onClick="go()">&nbsp;&nbsp;&nbsp; <input type="button" value="Cancel" onClick="cancel()"> when user choose any one and click "select" button, the value will be transfered to original window:
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end of the form which is submit and cancel. After i have clicked submit, the information is stored directly into my corresponding database table. My problem here is i need to retrieve back the information submitted to display all the data that the...
by: TechnoAtif | last post by:
Hi ALL I have entered some array values using checkboxes into mysql database through a form. Next iam creating a searchpage where all those cateogories inserted through checkboxes has to be retrieved using list/menu box. When i check only a single checkbox to insert the checked category ,selecting that category through list box gives out the entire data of the user corresponding to that category. However when i check multiple checkboxes and...
by: Archanak | last post by:
Hi, I have table like this: select * from sampletest; | title | description ...
by: phillx | last post by:
I am uncertain of the exact terminology and I am extremely hopeful that some will be able to assist me. 8) Below is a sample of the code - what I need is to collect the results of the selection. In this case a user selects a city/cities (in Texas) - This will be added to their favorites list. <head> <title>Select Cities</title> <script language="javascript"> function addOption(selectbox,text,value ) {
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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,...
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...
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...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.