Ben_Entrew
Registered User.
- Local time
- Today, 12:53
- Joined
- Dec 3, 2013
- Messages
- 177
Hi all,
I want to group a table and show a new column. This new column should be the sum two other columns of the original table called TEST_FC.
Somehow it asks me for parameter with this code.
Your help is much appreciated.
Thanks in advance.
Regards,
Ben
I want to group a table and show a new column. This new column should be the sum two other columns of the original table called TEST_FC.
Somehow it asks me for parameter with this code.
Your help is much appreciated.
Thanks in advance.
Regards,
Ben
Code:
Public Sub FC_QUERY()
Dim strSQL As String
Dim qdf As QueryDef
strSQL = "SELECT TEST_FC.[Division],TEST_FC.[Customer_Split],[two months FC] " & _
" FROM TEST_FC " & _
" WHERE [two months FC] = TEST_FC.[TNS 1 FC in TRY_SUM]+ TEST_FC.[TNS 2 FC in TRY_SUM] " & _
" GROUP BY TEST_FC.[Division],TEST_FC.[Customer_Split],[two months FC]"
With CurrentDb
Set qdf = CurrentDb.CreateQueryDef("FC_QUERY", strSQL)
.Close
End With
End Sub