Jump to content

Difference between two columns


Go to solution Solved by budimir,

Recommended Posts

Guys how can I make this query work

SELECT SUM(iznos_fakture) as ukupno 
FROM fakture_placanja 
WHERE iznos_placanja != iznos_fakture 
AND MONTH(datum_dospijeca) = '12' 

I need to find where iznos_placanja is different from iznos_fakture. They are two columns in same DB?

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/299759-difference-between-two-columns/
Share on other sites

iznos_fakture (DECIMAL (10,2)) is amount of invoice to be payed

iznos_placanja (DECIMAL (10,2)) is amount payed for that invoice

MONTH(datum_placanja) is month when that invoice is due

 

I would like to find all invoices in december that are not yet payed. I see in table that there are two invoices not payed. For some reason I can't display them. No errors. I'm getting empty result.

Edited by budimir
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.