[web2py] Re: datetime delta with Sqlite - how to?

2012-11-24 Thread apps in tables
Thank you... The best feature in web2py is its community... On Saturday, November 24, 2012 5:01:32 PM UTC+3, dederocks wrote: > > Hi, > > I've used the following query successfuly: > query = > (db.mesures.date.epoch()-db.lots.date_fabrication.epoch()) >= > (critere.valeur

[web2py] Re: datetime delta with Sqlite - how to?

2012-11-24 Thread dederocks
Hi, I've used the following query successfuly: query = (db.mesures.date.epoch()-db.lots.date_fabrication.epoch()) >= (critere.valeur_inf*86400) And then db(query).select(...) mesures.date and lots.date_fabrication are datetime fields. Hope this helps! Le jeudi 22 novembre

[web2py] Re: datetime delta with Sqlite - how to?

2012-11-24 Thread Paolo Caruccio
As a reference, you can see the example given by Massimo Di Pierro in this post https://groups.google.com/forum/#!msg/web2py/NXhu8PmvHOs/aO-oum4m0NgJ Il giorno sabato 24 novembre 2012 05:36:48 UTC+1, apps in tables ha scritto: > > I am using web2py 2.2.1 . I did import time in db.py > > still the

[web2py] Re: datetime delta with Sqlite - how to?

2012-11-23 Thread apps in tables
I am using web2py 2.2.1 . I did import time in db.py still the error , epoch is not defined. What did i do wrong? Ashraf On Saturday, November 24, 2012 7:13:18 AM UTC+3, apps in tables wrote: > > sorry, I need to use 2.1.1 or above. > > On Saturday, November 24, 2012 6:57:33 AM UTC+3, apps in t

[web2py] Re: datetime delta with Sqlite - how to?

2012-11-23 Thread apps in tables
sorry, I need to use 2.1.1 or above. On Saturday, November 24, 2012 6:57:33 AM UTC+3, apps in tables wrote: > > Hi Niphlod, > > I got > > (global name 'epoch' is not defined) > > I am using version 2.0.9 > > What did i miss? > > Ashraf > > On Friday, November 23, 2012 1:54:31 AM UTC+3, Niphlod wro

[web2py] Re: datetime delta with Sqlite - how to?

2012-11-23 Thread apps in tables
Hi Niphlod, I got (global name 'epoch' is not defined) I am using version 2.0.9 What did i miss? Ashraf On Friday, November 23, 2012 1:54:31 AM UTC+3, Niphlod wrote: > > Mind that the functionality is database dependant, hence you won't get the > same results changing the db engine. Moreover

[web2py] Re: datetime delta with Sqlite - how to?

2012-11-23 Thread dederocks
Thank you so much -- saved quite a bit of work! With much appreciation, Andre Le jeudi 22 novembre 2012 23:54:31 UTC+1, Niphlod a écrit : > > Mind that the functionality is database dependant, hence you won't get the > same results changing the db engine. Moreover you get different "rounding" >

[web2py] Re: datetime delta with Sqlite - how to?

2012-11-22 Thread Niphlod
Mind that the functionality is database dependant, hence you won't get the same results changing the db engine. Moreover you get different "rounding" errors trying to subtract similar dates. Recent web2py's DAL supports an "epoch()" method that returns "seconds passed since 1-1-1970". If you ca