Don't know if this is the proper newsgroup to post to. Sorry if not.
Can't figure this one out. Using Access 2003. I have 2 tables, IMast
(table of part info) and THist (part transaction history).
I need to select all parts that have a product code = "CAST" and list
the last 10 history transaction if they are within 90 days of the run
date.
From the IMast table I need the columns: part, descr, pcode. From the
THist I need: wonumber, wodate, wocust, ..... I will need a few more
columns from each of the tables for the final report.
I've tried many variations of the Select statement without success.
Such as:
Select part, desc, pcode
from (Select top 10 wonumber, wodate, wocust
from THist
where (pcode = "CAST") and (part=wopart) and ((thisdate -
wodate) < 91)
order by part, wodate, wonumber
Looking for a solution,
Hexman 2 1381
FROM using subquery not a table(s) is not supported in SQL92.
<code lang="SQL" type="AirCode">
SELECT TOP 10 i.part, i.descr, i.pcode, p.wonumber, p.wodate, p.wocust
FROM IMast i INNER JOIN THist p ON i.part = p.wopart
WHERE i.pcode = "CAST"
AND ((thisdate - wodate) < 91)
</code>
Regards John
"Hexman" <He****@binary.com> wrote in message
news:48********************************@4ax.com... Don't know if this is the proper newsgroup to post to. Sorry if not.
Can't figure this one out. Using Access 2003. I have 2 tables, IMast (table of part info) and THist (part transaction history).
I need to select all parts that have a product code = "CAST" and list the last 10 history transaction if they are within 90 days of the run date.
From the IMast table I need the columns: part, descr, pcode. From the THist I need: wonumber, wodate, wocust, ..... I will need a few more columns from each of the tables for the final report.
I've tried many variations of the Select statement without success. Such as:
Select part, desc, pcode from (Select top 10 wonumber, wodate, wocust from THist where (pcode = "CAST") and (part=wopart) and ((thisdate - wodate) < 91) order by part, wodate, wonumber
Looking for a solution,
Hexman
John,
An Order By clause is also needed, so the Top 10 will return the appropriate
data.
Kerry Moorman
"John Griffiths" wrote: FROM using subquery not a table(s) is not supported in SQL92.
<code lang="SQL" type="AirCode">
SELECT TOP 10 i.part, i.descr, i.pcode, p.wonumber, p.wodate, p.wocust FROM IMast i INNER JOIN THist p ON i.part = p.wopart WHERE i.pcode = "CAST" AND ((thisdate - wodate) < 91)
</code>
Regards John
"Hexman" <He****@binary.com> wrote in message news:48********************************@4ax.com... Don't know if this is the proper newsgroup to post to. Sorry if not.
Can't figure this one out. Using Access 2003. I have 2 tables, IMast (table of part info) and THist (part transaction history).
I need to select all parts that have a product code = "CAST" and list the last 10 history transaction if they are within 90 days of the run date.
From the IMast table I need the columns: part, descr, pcode. From the THist I need: wonumber, wodate, wocust, ..... I will need a few more columns from each of the tables for the final report.
I've tried many variations of the Select statement without success. Such as:
Select part, desc, pcode from (Select top 10 wonumber, wodate, wocust from THist where (pcode = "CAST") and (part=wopart) and ((thisdate - wodate) < 91) order by part, wodate, wonumber
Looking for a solution,
Hexman This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Sean C. |
last post by:
Helpful folks,
Most of my previous experience with DB2 was on s390 mainframe systems
and the optimizer on this platform always seemed very predictable and
consistent. Since moving to a WinNT/UDB...
|
by: Steve Jorgensen |
last post by:
Hi all,
Over the years, I have had to keep dealing with the same Access restriction -
that you can't update a table in a statement that joins it to another
non-updateable query or employs a...
|
by: Andrew McNab |
last post by:
Hi folks,
I have a problem with an MS Access SQL query which is being used in an
Access Report, and am wondering if anyone can help.
Basically, my query (shown below) gets some records from a...
|
by: Warren |
last post by:
I am trying to create a report that does the following:
Access Data in Query:
NAME | DATE | SALE TYPE |
-------------------------
John DOE | 1282003 | TYPE A
Jane DOE | 1282003 | TYPE C...
|
by: kandiko |
last post by:
Hi all,
Here is my dilemma.
I have two tables, one called HS DATA and one called
ImportedHighSchools.
Both tables contain an ID code for each record.
|
by: Steve Jorgensen |
last post by:
Hi all,
Frankly, this is such an off-beat thing, I don't know if anyone else here will
ever have the same issue. Just in case anyone does, though...
I needed to be able to search for the...
|
by: Hexman |
last post by:
Hello All,
How do I limit the number of detail records selected in a Master-Detail set using SQL?
I want to select all master records for a date, but only the first 3 records for the details...
|
by: timn |
last post by:
Translating Access SQL queries into SQL subqueries.
--------------------------------------------------------------------------------
I have a query in Access that uses a subquery, I would like...
|
by: NeoPa |
last post by:
Access QueryDefs Mis-save Subquery SQL
Access stores its SQL for Subqueries in a strange manner :s It seems to replace the parentheses "()"with square brackets "" and (often) add an extraneous...
|
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,...
|
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$) {
}
...
|
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...
|
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
|
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...
|
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...
|
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,...
|
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,...
|
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...
| |