title: Mysql simple query and values in a column but wrong SUM result
body: <p>Query:</p>
  
  <pre><code>SELECT SUM(USDamount) as totalsales
  FROM invoice_table 
  WHERE DATE LIKE '2014-01-%'
  </code></pre>
  
  <p>shows <code>3927.3400</code> as result</p>
  
  <p>but when I calculate real result manuall, it is <code>5117.54</code></p>
  
  <p>Previously field type was varchar(12) now I changed it to decimal(10,5)  but result is still the same.</p>
  
  <p>When I run following query:</p>
  
  <pre><code>(SELECT * 
  FROM invoice_table 
  WHERE DATE LIKE '2014-01-%');
  </code></pre>
  
  <p>which is same excep here I used <code>SELECT *</code> instead of <code>select SUM(USDamount)</code></p>
  
  <p>Following values are displayed in result and manual total of these values is different than SUM function calculated values:</p>
  
  <pre><code> 509
   75
   20
   250
   75
   35
   20
   90
   30
   51
   567
   80
   185
   20
   40
   480
   40
   60
   80
   70
   1191.2
   40
   45.24
   113.4
   210
   42.7
   510
   188
  </code></pre>
  
  <p>Any help will be greatly appreciated. Thanks!</p>
  
  <p>=================================================================</p>
  
  <p>Here is complete table structure:</p>
  
  <pre><code>Name    Type    Collation   Attributes  Null    Default Extra   Action
  1   id  mediumint(9)            No  None    AUTO_INCREMENT  Change Change   Drop Drop   
  
  2   username    varchar(100)    latin1_swedish_ci       No  None        Change Change   Drop Drop   
  
  3   date    datetime            No  None        Change Change   Drop Drop   
  
  4   ptransactionid  varchar(150)    latin1_swedish_ci       No  None        Change Change   Drop Drop   
  
  5   paymethod   tinytext    latin1_swedish_ci       No  None        Change Change   Drop Drop   
  
  6   amount  decimal(10,4)           No  None        Change Change   Drop Drop   
  
  7   USDamount   decimal(10,4)           No  None        Change Change   Drop Drop   
  
  8   paidincurrency  varchar(5)  latin1_swedish_ci       No  None        Change Change   Drop Drop   
  
  9   paidfororders   text    latin1_swedish_ci       No  None        Change Change   Drop Drop   
  
  10  paidby  text    latin1_swedish_ci       No  None        Change Change   Drop Drop   
  
  11  status  varchar(100)    latin1_swedish_ci       No  None        Change Change   Drop Drop   
  
  12  chargedvia  varchar(100)    latin1_swedish_ci       No  None        Change Change   Drop Drop   
  
  13  remainingamountcredit   varchar(12) latin1_swedish_ci       No  None        Change Change   Drop Drop   
  </code></pre>
  
  <p>Also there is no typing mistake. These values were automatically inserted by merchant account website after successful payment via success URL. I exported the result of select * from .... and calculated via excel sum result of column USDamount and result was accurate so this confirms no typing mistake. Please help. This is driving me crazy as I have already tried everything to make sum work correctly :(</p>