Hi Jason, thanks for the suggestion - I tried that but it didn't give any different results.
Anyway, I've found a different way to structure the query using GROUP BY clauses. It's giving the right results but just doesn't seem as elegant as a sub-query!
Thanks for your help,
Thanks for the reply Jason - code is as follows:
SELECT
Table1.Field1,
Table1.Field2,
Table2Derived.Field3
FROM
(SELECT
Table2.Field1,
SUM(Table2.Field4) AS Field3
FROM
Table2
WHERE
Table2.Field6 IN (?,?,?,?)
GROUP BY Table2.Field1)
Table2Derived
INNER JOIN Table1 ON...
Hi all,
I am writing a SQL query in the TableAdapter Query Configuration Wizard and it includes a Subquery.
I have some parameters in my main query, and would like to have a parameter in the Subquery also. My query works up until the point where I add a parameter to the Subquery, when it stops...
Hi drlex, it worked fine and I'm getting the results I need. I didn't really know about aliases before so I can see now that they are pretty useful!
Thanks for your help,
Hi Drlex, thanks for your response.
I think I understand what you are getting at but here are some examples to make sure we are on the same page:
So for example my Second table could have the following data:
SecondTableId SecondTableText
1 Days
2 Years
3...
Hi all,
So I'm familiar with the technique of using SQL to return the text values in an external table which are linked to my main table using Lookup fields as follows:
SELECT
MainTable.RecordId, SecondTable.RecordName
FROM
MainTable INNER JOIN SecondTable
ON
MainTable.SecondTableId =...
Thanks Lespaul,
I had seen the page you linked before but I couldn't see a close enough example to what I was trying to do to figure it out.
With the way you wrote my code I have tried that and it is working fine so thanks for that. I was trying to make it more complicated than it is and I can...
Hi all - first post and I hope I have the right section of the forum...
I have 3 seperate SELECT statements that I would like to combine into one. I have four Tables called "Client", "Letters", "Agreement" and "Rate", which are linked in that order via ID values. Rate also links to a number of...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.