Click here to Skip to main content
16,020,249 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have a table which has lot of products and quantites withdrawn for each product ...

I need to create a screen to show a total products' quantities for each month.

please help.

additional information copied from comment below
Well, I have tried the following code:
VB
Private Sub Query3_PreprocessQuery(ByRef query As System.Linq.IQueryable(Of LightSwitchApplication.Stock))
query = From n In query _
Group n By n.Order_Date.year, n.Order_Date.month, n.Product_Name Into g=Group _
Select year,month,Product_Name,Quantity = g.sum(Function(n) n.Quantity)
End Sub


My code causes the screen based on Query3 not to load any data...

Please help me, I need to get each product quantites (grouped per month and per product name).

Thanks is advance
Posted
Updated 13-Sep-14 14:08pm
v2
Comments
Nelek 13-Sep-14 16:36pm    
Perfect, go ahead and have fun coding.

Since you didn't ask any question, it is difficult to give you a better answer.

I strongly recommend you to read:
How to ask a question[^] and What have you tried?[^]
ehabelnahas 13-Sep-14 17:16pm    
I did already, and I posted another post with the details ... but I waited so long for answers with no success.
ehabelnahas 13-Sep-14 17:17pm    
Well, I have tried the following code:

Private Sub Query3_PreprocessQuery(ByRef query As System.Linq.IQueryable(Of LightSwitchApplication.Stock))
query = From n In query _
Group n By n.Order_Date.year, n.Order_Date.month, n.Product_Name Into g=Group _
Select year,month,Product_Name,Quantity = g.sum(Function(n) n.Quantity)
End Sub

My code causes the screen based on Query3 not to load any data...

Please help me, I need to get each product quantites (grouped per month and per product name).

Thanks is advance

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900