Jump to content

Recommended Posts

What do you I did not alter the data?What table or should i alter?

And also what table or data should I update?

 

I thought dipping table get updated with new quantities ... to zero if completely utilized or to a new number if it partially used.

 

 

If you are not updating the table.. it is very tricky to correlate with table where you inserting the data and display the data for next JO.

 

try this..  I don't have access to mysql server now so I didn't test the code .

 

SELECT SUBSTR(LOT_CODE, 9,4) as pcode, LOT_CODE as code, op_qty,  DATE_ENTRY,   CASE WHEN @t+op_qty > @rqty THEN @rqty  - @t  ELSE op_qty END as qty,@t := @t + d.op_qty as cumulative  from 

((select LOT_CODE,output_qty -qty as op_qty,date_entry from jo_dump where output_qty > qty and SUBSTR(LOT_CODE, 9,4) = '$Comp' order by date_entry desc limit 1) UNION

(select LOT_CODE,output_qty as op_qty ,date_entry from dipping  where date_entry >(select ifnull(date_entry, '0000-00-00') from jo_dump where output_qty > qty and SUBSTR(LOT_CODE, 9,4) = '$Comp' order by date_entry desc limit 1))) d  WHERE (@t < @rqty);

 

Looking at my query I can tell you that...tables design is wrong.

@newphpcoder,

 

See my php code for this mysql query in your other thread on this subject in another forum

 

http://www.phpfreaks.com/forums/index.php?topic=359370.msg1699211#msg1699211.

 

This is the last help from me - having two threads just wastes people's time.

What do you I did not alter the data?What table or should i alter?

And also what table or data should I update?

 

I thought dipping table get updated with new quantities ... to zero if completely utilized or to a new number if it partially used.

 

 

If you are not updating the table.. it is very tricky to correlate with table where you inserting the data and display the data for next JO.

 

try this..  I don't have access to mysql server now so I didn't test the code .

 

SELECT SUBSTR(LOT_CODE, 9,4) as pcode, LOT_CODE as code, op_qty,  DATE_ENTRY,   CASE WHEN @t+op_qty > @rqty THEN @rqty  - @t  ELSE op_qty END as qty,@t := @t + d.op_qty as cumulative  from 

((select LOT_CODE,output_qty -qty as op_qty,date_entry from jo_dump where output_qty > qty and SUBSTR(LOT_CODE, 9,4) = '$Comp' order by date_entry desc limit 1) UNION

(select LOT_CODE,output_qty as op_qty ,date_entry from dipping  where date_entry >(select ifnull(date_entry, '0000-00-00') from jo_dump where output_qty > qty and SUBSTR(LOT_CODE, 9,4) = '$Comp' order by date_entry desc limit 1))) d  WHERE (@t < @rqty);

 

Looking at my query I can tell you that...tables design is wrong.

 

 

I tried this no error but no output display.

 

 

Thank you

I tried to think on how can i resolved it, how can I code it to resolve this problem and yet I can't figured out or think what code should resolve my problem.

 

 

Thank you for your effort to help me..Sorry im not good in logic and coding :(

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.