NJudson
Who farted?
- Local time
- Today, 13:16
- Joined
- Feb 14, 2002
- Messages
- 297
I want to output the results of an SQL statement into a listbox on my form and when I run it the listbox is just blank. Can someone take a look at my SQL for any errors or if there may be a common mistake that I may be making in setting up my listbox? The SQL looks like this:
Me.ListAverage.RowSource = "SELECT SUM([Totals2].[RBER Drop Attempts/Call Volume]) AS [SumOfRBER Drop Attempts/Call Volume], " & _
"COUNT([Totals2].[RBER Drop Attempts/Call Volume]) AS [Totals2].[CountOfRBER Drop Attempts/Call Volume], " & _
"([SumOfRBER Drop Attempts/Call Volume]/[CountOfRBER Drop Attempts/Call Volume])*100 AS Average INTO AverageRBER " & _
"FROM Totals2 " & _
"WHERE [Totals2].[Cell-ID] = '" & Me.ListTotals & "' " & _
"And [Totals2].[Switch] = '" & SWITCH & "' " & _
"GROUP BY [SumOf RBER Drop Attempts/Call Volume]/[CountOfRBER Drop Attempts/Call Volume])*100;"
basically the SQL is trying to take the (Sum(Field1)/Count(Field1))*100 which as we all know = Average and it's this average that I want to display in my listbox on the form but it's not working. Is there a specific format that I need to setup my listbox as?
Thanks.
Me.ListAverage.RowSource = "SELECT SUM([Totals2].[RBER Drop Attempts/Call Volume]) AS [SumOfRBER Drop Attempts/Call Volume], " & _
"COUNT([Totals2].[RBER Drop Attempts/Call Volume]) AS [Totals2].[CountOfRBER Drop Attempts/Call Volume], " & _
"([SumOfRBER Drop Attempts/Call Volume]/[CountOfRBER Drop Attempts/Call Volume])*100 AS Average INTO AverageRBER " & _
"FROM Totals2 " & _
"WHERE [Totals2].[Cell-ID] = '" & Me.ListTotals & "' " & _
"And [Totals2].[Switch] = '" & SWITCH & "' " & _
"GROUP BY [SumOf RBER Drop Attempts/Call Volume]/[CountOfRBER Drop Attempts/Call Volume])*100;"
basically the SQL is trying to take the (Sum(Field1)/Count(Field1))*100 which as we all know = Average and it's this average that I want to display in my listbox on the form but it's not working. Is there a specific format that I need to setup my listbox as?
Thanks.