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

Retrieve data using multiple select

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
and
(Actual = (Select nPassengers from tbl_Riders_NonRiders where dtDate = '11/05/06'
AND cReqType = 'i' and iTimeCode = '1' and iDeptCode = '1' )

Thanks
Nov 9 '06 #1
1 3432
scripto
143 100+
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(nPassengers) - Actual) Variance from tbl_BusRequest
where iReqTime = '1' and iDeptCode = '1' and cReqType = 'I'

and
(Actual = (Select nPassengers from tbl_Riders_NonRiders 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

16
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...
2
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...
1
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...
12
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...
1
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> ...
13
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...
4
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...
4
by: Archanak | last post by:
Hi, I have table like this: select * from sampletest; | title ...
9
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....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.