Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Need help to Update Database

Locked
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Need help to Update Database

Unread post by ruiascensao »

Hi,

I have 2 tables:

Table1 - Batch:
batch_id
batch_code
batch_min
batch_max
batch_status

Table2 - jobs (subform)
jobs_id
jobs_batch_id
jobs_code
jobs_min
jobs_max

I need to write a sql statemente to update the database:

batch_max=SUM(jobs_min) and Batch_min=sum(jobs_max) where batch_id =jobs_batch_id.

Then I need to change de batch status:

batch_max | batch_min | batch_status
>= 1 | 0 | Failed
1 | 1 | Failed
0 | 1 | Passed
0 | 2 | Failed

Can anyone please help me?
This seems to be complex ...

Thank You!

Rui
BR
Rui
admin
Site Admin
Posts: 2824
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 29 times

Re: Need help to Update Database

Unread post by admin »

Rui,

Its more a SQL question than a nuBuilder one.

you could try http://www.dbforums.com/mysql/

Steven
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Need help to Update Database

Unread post by ruiascensao »

Thank you for your suggestion.

Best Regards,
Rui
BR
Rui
admin
Site Admin
Posts: 2824
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 29 times

Re: Need help to Update Database

Unread post by admin »

.
Locked