Subject Re: sql code
From Peter Hegelbach <peter@hegelbach.com>
Date Wed, 13 Jun 2018 20:56:02 +0200
Newsgroups dbase.getting-started

Hi

Try:
sql = "select lname,sum(qty) as cnt, sum(qty*cost) as tcost,
sum(qty*sell) as tsell from taldata where lname ='"+talname+"' group by
lname"

Mind the apostrophs.

Peter


Am 13.06.2018 um 20:43 schrieb Charlie:
> Hi... what is wrong here?  I am trying to filter this sql statement with where using the variable talname, but I can't seem to get this to work for some reason.  I've gotten so many different error messages my head is spinning.
>
> Really appreciate any help!
>
> sql = "select lname,sum(qty) as cnt, sum(qty*cost) as tcost, sum(qty*sell) as tsell from taldata where lname ="+talname+" group by lname"
>


---
Diese E-Mail wurde von AVG auf Viren gepr├╝ft.
http://www.avg.com