[web2py] Re: sum decimal error?

2020-09-15 Thread villas
That's great Denes and good luck with your app :) On Monday, 14 September 2020 at 15:46:55 UTC+1 DenesL wrote: > I have found my mistake, in the query > db(ti.DocNum == doc) > I was using the wrong variable (doc) which is a row, > it should be docnum. > > Thanks villas for your help and words of

[web2py] Re: sum decimal error?

2020-09-14 Thread 'DenesL' via web2py-users
I have found my mistake, in the query db(ti.DocNum == doc) I was using the wrong variable (doc) which is a row, it should be docnum. Thanks villas for your help and words of encouragement. On Friday, September 11, 2020 at 11:26:51 AM UTC-4 DenesL wrote: > Hi villas > > thanks for your suggest

[web2py] Re: sum decimal error?

2020-09-14 Thread villas
Hi Denes Now that you are making things work on the commandline, you should be able to figure it out. Maybe you don't need a groupby. Maybe you have a non-integer value in one of the fields (yes, this kind of thing could happen on sqllite). An integer saved as a string will be converted to

[web2py] Re: sum decimal error?

2020-09-11 Thread 'DenesL' via web2py-users
Hi villas thanks for your suggestion. I ran a test in the shell and it works: web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2020 Version 2.20.4-stable+timestamp.2020.05.03.05.18.50 Database drivers available: sqlite3, pyodbc, imaplib, pymysql WARNING:web2py:import IPython erro

[web2py] Re: sum decimal error?

2020-09-11 Thread villas
Are you sure your *doc *search value is an integer? Maybe a little more experimentation. Simplify and then incrementally add complexity. Start here... ss = db(ti.DocNum == 99).select(scnqtysum) Also, check the SQL: ss = db(ti.DocNum == doc)._select(scnqtysum) ## note the underline chr _

[web2py] Re: sum decimal error?

2020-09-10 Thread 'DenesL' via web2py-users
Hi villas thanks for your reply. There should be no NULLs in there since I deleted all tables and started from a blank slate. Still no idea why this happens. Why is trying to use __int__ if it is a decimal?. Denes On Thursday, September 10, 2020 at 12:04:44 PM UTC-4 villas wrote: > Hi Denes >

[web2py] Re: sum decimal error?

2020-09-10 Thread villas
Hi Denes Just a thought, and I'm not sure if this is the answer, but the following indicates that there is a null value in the DB field: TypeError: __int__ returned non-int (type NoneType) Maybe you initially created the field without a default and then added the default=0.0 later. This may