Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3483 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 20
15687
16
ส.ค. 19
10802
1
ม.ค. 19
5786
5
มิ.ย. 18
11237
0
ก.ย. 17
2786