• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Same query, different results

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And a second question,





This is the library I am using
http://technojeeves.com/joomla/i ... ltset-to-tablemodel
The product name is missing
same query, different results.jpg
[Thumbnail for same query, different results.jpg]
Different results.jpg
[Thumbnail for Different results.jpg]
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean different as in one result got an extra decimal point?

To be consistent, ideally you should round after you sum IFNULL(round(sum(od.NetSales), 2), 0)

Or even better do the IFNULL check before you round.

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K. Tsang wrote:You mean different as in one result got an extra decimal point?

To be consistent, ideally you should round after you sum IFNULL(round(sum(od.NetSales), 2), 0)

Or even better do the IFNULL check before you round.



Hi K Tsang,
I mean the product name was missing in the query inside Java.
I don't know why, I cut N paste the query to SQLite Manager,
It works, but when in java, it doesn't
The thing was so similar, I can't see why it differs
Thanks
Jack
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic