Topic: need help

help to calculate between 2 database and show result in Form1.TableGrid1 for zakaz database like show in photo...

Post's attachments

Attachment icon help.png 119.54 kb, 236 downloads since 2016-02-23 

Re: need help

You should create calculated field:

IFNULL(zakaz.cost, 0) - (SELECT IFNULL(db.dbCost, 0) FROM db WHERE db.id=zakaz.id_db)
Dmitry.

3 (edited by megood70 2016-02-26 11:15:22)

Re: need help

pease help me i will send for you sample project not work with this code IFNULL(zakaz.cost, 0) - (SELECT IFNULL(db.dbCost, 0) FROM db WHERE db.id=zakaz.id_db).......please check for me....thanks

Re: need help

You have wrong structure of project.


You have foreign key in the table "Zakaz" (id_db) but there is no in the forms any ComboBox or child TableGrid to create this relationship between tables.


Please check out this video lesson:
https://www.youtube.com/watch?v=bG30pqCrw8k


You should to understand how works with foreign keys in database.


Also check out this topic
http://myvisualdatabase.com/forum/viewtopic.php?id=986



Thanks.

Dmitry.