sormasi ayip bu sql i nasil deneyebiliriz?
denemeye gerek yok.. çok basit bişey, bilen tak diye söylicek..
strReportSQL = "SELECT " & strReportType & " as GroupName, count(*) as Qty2, fldDiscount, ord2.SubTotal " & _
"From tblOrders ord1 Left Join ( " & _
"SELECT " & strReportType & " as GroupName, count(*) as QTY, Sum(fldQuantity * fldProdPrice) as SubTotal " & _
"From tblOrderItems as item, tblProducts as prod, tblOrders as ord " & _
"Where item.fldProductID = prod.fldID " & _
"and item.fldOrderId = ord.fldID " & _
"and fldPartyDate >= #" & strDateStart & "# And fldPartyDate <= #" & strDateEnd & "# " & _
"Group by " & strReportType & " " & _
") as ord2 ON ord1." & strReportType & " = ord2.GroupName " & _
"Where fldPartyDate >= #" & strDateStart & "# And fldPartyDate <= #" & strDateEnd & "# " & _
"group by " & strReportType & ", SubTotal "Dene bakalım ne olacak
Microsoft JET Database Engine error '80040e21'
You tried to execute a query that does not include the specified expression 'fldDiscount' as part of an aggregate function.
group by'da sorun war.. 2 group by olması biraz kasınç yapmış..