Thread: Run-query error
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JohnDing JohnDing is offline
external usenet poster
 
Posts: 5
Default Run-query error

SQL = "SELECT Period, CDF_No, SAFE_No, Invoice_No,
Currency, Sum(Total_Amount) AS Total_Amount_Sum, Country
FROM EXPSALESDB GROUP BY Invoice_No HAVING ((Period ='" &
Period & "')) ORDER BY Invoice_No"

Thanks, Nick
-----Original Message-----
John,
What's the SQL behind the query ?

NickHK

"JohnDing" wrote in message
...
Hi,

I encountered an error while attempted to run a query

in
a Excel-VBA subroutine to get data in a MDB database.
error reported as following:

Run time error'-2147217887'
You tried to execute a query that does not include the
specified expression 'Period' as part of an aggregate
function.

But I do have the field 'period', would somebody can

help?


.