I am trying to understand a SQL statement created by someone else. The Sql statement built is the following:
INSERT INTO Table2 ( Division, Customer_Number, Customer_Name, Invoice_Number, Invoice_Date, Net_Invoice_Amount, Freight_amount, Invoice_Amount) SELECT Table1.[Division], Table1.[CustomerNumber], [AR1_CustomerMaster].[CustomerName], Table1.[InvoiceNumber], Table1.[InvoiceDate], sum(Table1.[NonTaxableSalesAmount]), sum(Table1.[FrghtAmount]), sum(Table1.[FrghtAmount] + Table1.[NonTaxableSalesAmount] + Table1.[TaxableSalesAmount] + + Table1.[SalesTaxAmount]) FROM Table1 WHERE Table1.[InvoiceDate]= #DateFromInputBox#
My question is: Does the + + do anything or is it just a typo? It doesn't seem to affect the query, but I don't know what a "++" in the sum function does (or if it really does anything). Any help would be appreciated.
Thanks in advance,
rixx
INSERT INTO Table2 ( Division, Customer_Number, Customer_Name, Invoice_Number, Invoice_Date, Net_Invoice_Amount, Freight_amount, Invoice_Amount) SELECT Table1.[Division], Table1.[CustomerNumber], [AR1_CustomerMaster].[CustomerName], Table1.[InvoiceNumber], Table1.[InvoiceDate], sum(Table1.[NonTaxableSalesAmount]), sum(Table1.[FrghtAmount]), sum(Table1.[FrghtAmount] + Table1.[NonTaxableSalesAmount] + Table1.[TaxableSalesAmount] + + Table1.[SalesTaxAmount]) FROM Table1 WHERE Table1.[InvoiceDate]= #DateFromInputBox#
My question is: Does the + + do anything or is it just a typo? It doesn't seem to affect the query, but I don't know what a "++" in the sum function does (or if it really does anything). Any help would be appreciated.
Thanks in advance,
rixx