Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Complex query

Author  Topic 

ilimax
Posting Yak Master

164 Posts

Posted - 2004-04-24 : 10:57:02
I want to make one a little bit a complex query and I have trouble.
It's going on this way; I have columnes A,B,C,D,E
I want to group by column A, Summarize column D and E and make extra column F which needs to be =D*E

This is my query. It's working without grouping and summarizing Quantity. I am trying all of this in VB 6 application, but if works in Access, will work in VB too.


sql = "SELECT [Inventory Products].UpdateDate, [Inventory Products].[Item Number], Inventory.[UPC Code], Inventory.Description, [Inventory Products].[Quantity Received] AS Quantity, [Inventory Products].[Quantity Received]*[Inventory].[Cost] AS Cost, [Inventory Products].Color FROM [Inventory Products] INNER JOIN Inventory ON [Inventory Products].[Item Number] = Inventory.[Item Number] WHERE ((([Inventory Products].UpdateDate) Between '" & fdate & "' And '" & tdate & "') AND (([Inventory Products].[Supplier Number])='111'));"

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-04-26 : 04:48:35
so...what do B,C add to the result?
sample input data, matched with the corresponding expected results would be useful.....
Go to Top of Page

ilimax
Posting Yak Master

164 Posts

Posted - 2004-04-26 : 09:36:02
I solved the problem. Sometimes we make too complicate for nothing and do not see very simple solution.

Thanks Andrew for your help,

Ilimax
Go to Top of Page
   

- Advertisement -