Thanks for your help. But it still shows error if i add one more variable from Award table. Script error detected at line 26. Source line: Set rs = con.Execute("SELECT E.Award1, SUM(E.Award_No) as cc,E.Name1 FROM Award E where E.Award_Date >= #" & date1 & "# and E.Award_Date <= #" & date2 & "# GROUP BY E.Award1 ORDER BY sum(E.Award_No) desc") Description: [Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified expression 'Name1' as part of an aggregate function. Set rs = con.Execute("SELECT E.Award1, E.Name1, SUM(E.Award_No) as cc FROM Award E where E.Award_Date >= #" & date1 & "# and E.Award_Date <= #" & date2 & "# GROUP BY E.Award1 ORDER BY sum(E.Award_No) desc") If i remove E.Name1 variable it works fine but i need rest of the variables too from
Award table. Thanks again, Kathy
Get amazing travel prices for air and hotel in one click on Yahoo! FareChase
|