473,378 Members | 1,354 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.

three select statement

Hi Anybody,

is this select statement is possible.

select nQtyOut, nQtyIn
from (
Select sum(a.nQtyOut) nQtyOut from
tbl_StationData a, tbl_Materials b
where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '11' and
convert(datetime, convert(varchar, b.dtFinished, 101)) = '12/04/06' and
Select sum(a.nQtyIn) nQtyIn from
tbl_BatchQty a, tbl_Materials b
where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '4' and
convert(datetime, convert(varchar, b.dtFinished, 101)) = '12/04/06' )

Thanks
Dec 5 '06 #1
1 2113
xpcer
51
Hi Anybody,

is this select statement is possible.

select nQtyOut, nQtyIn
from (
Select sum(a.nQtyOut) nQtyOut from
tbl_StationData a, tbl_Materials b
where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '11' and
convert(datetime, convert(varchar, b.dtFinished, 101)) = '12/04/06' and
Select sum(a.nQtyIn) nQtyIn from
tbl_BatchQty a, tbl_Materials b
where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '4' and
convert(datetime, convert(varchar, b.dtFinished, 101)) = '12/04/06' )

Thanks

select nQtyOut, nQtyIn
from (
Select sum(a.nQtyOut) nQtyOut from
tbl_StationData a, tbl_Materials b
where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '11' and
convert(datetime, convert(varchar, b.dtFinished, 101)) = '12/04/06'
UNION ALL
Select sum(a.nQtyIn) nQtyIn from
tbl_BatchQty a, tbl_Materials b
where b.dtFinished is not null and a.vcSONo = b.vcSONo and a.nStationId = '4' and
convert(datetime, convert(varchar, b.dtFinished, 101)) = '12/04/06' )
Dec 6 '06 #2

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

Similar topics

3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
7
by: RLN | last post by:
Re: Access 2000 I have three history tables. Each table contains 3 years worth of data. All three tables have a date field in them (and autonum field). Each table has the potential to contain...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
19
by: Steve | last post by:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement I got ASP error number 13 when I use the SELECT...FOR UPDATE statement as below. However, if I use SELECT statement without...
1
by: Stephene | last post by:
New to the world of web design/php/mysql and need help please. What I'm trying to do: I would like a web page with three drop down menus each populated by a query The first represents...
6
by: John | last post by:
Hi I have three tables with a common id with which they can be linked. I need to merge them in a way that the resultant table has all records from three tables. Below is what sort of result I am...
5
by: john7 | last post by:
I have three tables one for categories, one for products1 and another for products2. I am using PHP and MySQL. so for example I categories categoryid name 1 programming 2 databases 3 ...
1
by: doc1355 | last post by:
I have a feeling that this is an easy question. However I'm a newbee and don't have any idea how to do this. I have three tables that stores my users information. Each user has a unique ID that is...
1
by: Big X | last post by:
I have already achieved this in access and was trying with straight SQL earlier I would just like to know what I'm doing wrong in sql or what syntax I'm missing. I have three tables with identical...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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: 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...

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.