Re: [web2py] sqlform.grid query question

2013-09-05 Thread Richard Vézina
Good! Richard On Thu, Sep 5, 2013 at 5:55 AM, António Ramos wrote: > Bingo! > having =(count1 % 2* *==* *1) > > > 2013/9/5 António Ramos > >> Going with SQLTABLE i have my rows queried like >> >> count1=db.card_logs.id.count() >> >> (db.)select(db.trabalhador.nome,db.trabalhador.area,

Re: [web2py] sqlform.grid query question

2013-09-05 Thread António Ramos
Bingo! having =(count1 % 2* *==* *1) 2013/9/5 António Ramos > Going with SQLTABLE i have my rows queried like > > count1=db.card_logs.id.count() > > (db.)select(db.trabalhador.nome,db.trabalhador.area,count1,groupby=db.trabalhador.nome, > *having =(count1 % 2 = 1)*) > > > the *having* c

Re: [web2py] sqlform.grid query question

2013-09-05 Thread António Ramos
Going with SQLTABLE i have my rows queried like count1=db.card_logs.id.count() (db.)select(db.trabalhador.nome,db.trabalhador.area,count1,groupby=db.trabalhador.nome, *having =(count1 % 2 = 1)*) the *having* clause is not accepted , how to do it to query only odd counts? I use sqlite!

Re: [web2py] sqlform.grid query question

2013-09-04 Thread Richard Vézina
Ok, so you need to check against actual time which person are still in... If you really just want the persons/users that are still in a give time, I think you need a group by over user_id... So you could set a limit of 2 records per user and if you have only one and it is a 'check in' stat value y

Re: [web2py] sqlform.grid query question

2013-09-04 Thread Richard Vézina
Don't understand what you need exactly... Is stat a string type containing 'check in' or 'check out' and you want just odd number of record or you have an other field with timestamp or something and you want only the odd hours to appear in the grid?? Richard On Wed, Sep 4, 2013 at 12:54 PM, Antó

Re: [web2py] sqlform.grid query question

2013-09-04 Thread António Ramos
If the user checks his rfid tag within 5 minutes of the last check the log does not record "check in" or "check out" but "error" 2013/9/4 António Ramos > yes , stat is a string with "chech in" or "check out" i also have a > timestamp for the check in or check out. > > I dont want odd /even hour

Re: [web2py] sqlform.grid query question

2013-09-04 Thread António Ramos
yes , stat is a string with "chech in" or "check out" i also have a timestamp for the check in or check out. I dont want odd /even hours I want to know if the user is checked in I have an RFID app to check in /out outside workers via an rfid tag. when the user checks firstime, the app records "