sum fonction in gadfly

jean-jeanot jean.moser at neuf.fr
Sat Jun 24 04:30:25 EDT 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(),
   varAmount.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

Sum.amout.transaction
=================
100-10.5.......

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