Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
3468 Visninger

I have column named Duration and on each row id 579 578 580 etc I have values in database. Now at Id 641, I need to add all the rows above this id that is: rows from 600 to 641 in duration cell. I tried below codes but none worked

Guide

Thanks

Codes:

1- self.write(cr,uid,641,{'duration':sum(duration)})

2- for rec in self.browse(cr, uid, ids, context=context): #cr.execute("SELECT count(duration) FROM activity_track WHERE id_d=641") #res = cr.fetchall()

3- self.write(cr,uid,641,{'duration':cr.execute("SELECT count(duration WHERE id=641) AS tot_ans FROM activity_track")})

activity_track is my table

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
jan. 20
15634
16
aug. 19
10733
1
jan. 19
5768
5
jun. 18
11203
0
sep. 17
2777