sum fonction in gadfly

jean-jeanot jean.moser at
Sat Jun 24 10:30:25 CEST 2006

I am writing a prototype program whose aim is to collect bookkeeping
transactions in a Database ( Gadfly).
After creating the table  I create the variables with
varAmount = StringVar()
I then create labels in Tkinter to ease the input of data.
With a function
def treatment ():
   requete = "insert into transactions ( date,amount,,....)
values(......) "% (varDate.get(),
I transfer data from the labels in Tkinter into the Database at the end
of the program
with a button named "End" . I print the Database with print cur.pp().
No problem up to now but then I try to use a select command:
cur.execute ("select sum(amount) from transactions").I get


instead of 110.5

It means that the select command does not add but concatenates the
different amounts. Why ?

Many thanks if you can help me.

Jean Moser

More information about the Python-list mailing list