i get error when i try to run query in access through C# -


I have this query:

  SELECT DO3Tbl.CodeDip, DO3Tbl.BarcodeD, Sum ( AS TOT, ABS (Overall) AS TotAb  

When I run this query in Access, it's an excellent job

But when I query this query in the C # code I run:

  SQL = SELECT DO3Tbl.CodeDip, DO3Tbl.BarcodeD, Sum (DO3Tbl.Qty) AS Quantity, Max (DO3Tbl.Mly) AS Mly, [volume] - [MALLI] AS Tott, ABS (Todd) AS Totebus CMD = New Almond Commands (SQL, Conn); Cmd.ExecuteNonQuery (); Cmd.Dispose ();  

I get this error:

You tried to execute a query in which the specified expression '[quantity] - [malli]' is not included as part of a The overall function is related to.

There is too much wrong with the query, For example, you are not choosing from any table, besides, you can not use the alias which is not a field Name is in the form of GAM. How about:

  SELECT DO3Tbl.CodeDip, DO3Tbl.BarcodeD, Sum (DO3Tbl.Qty) AS SumOfQty, Max (DO3Tbl.Mly) AS MaxOfMly, Yoga ([volume] - [Malli ]) AS Tott, ABS (Overall) AS Tot ABS DO3 TBL Group, DO3 TBL. CODEDP, DO3 TBL. BRCode;  

Comments