select form mysql limit only 2 digit after decimal

`sellhead`.  VatAmt   some time it like   80.124 but I want 80.12   and some time it like 80.125  I want 80.13  How can I do that



SELECT `sellhead`.TrnDate, `sellhead`.InvoiceNo, `sellhead`.CName, `sellhead`.
       VatAmt, `sellhead`.NetAmt
  FROM AOL.sellhead `sellhead`
 WHERE (`sellhead`.InvoiceNo LIKE '00%') AND Month(TrnDate) = 1 AND Year(TrnDate)=2008

`sellhead`.        VatAmt
CREATE TABLE `sellhead` (
  `Branch` varchar(3) NOT NULL DEFAULT '0',
  `Code` double NOT NULL DEFAULT '0',
  `TrnDate` datetime DEFAULT NULL,
  `TType` char(1) NOT NULL DEFAULT 'A',
  `AccTp` ENUM('R','C','Q','D') NOT NULL DEFAULT 'R',
  `DocType` ENUM('I','D') NOT NULL DEFAULT 'D',
  `InvoiceNo` varchar(10) DEFAULT NULL,
  `DocNo` varchar(10) DEFAULT NULL,
  `InvoiceDate` datetime DEFAULT NULL,
  `BackNo` varchar(10) DEFAULT NULL,
  `Reference` varchar(15) DEFAULT NULL,
  `cid` double NOT NULL DEFAULT '0',
  `CName` varchar(100) DEFAULT NULL,
  `Adr1` varchar(40) DEFAULT NULL,
  `Adr2` varchar(40) DEFAULT NULL,
  `Address` text,
  `Zip` varchar(5) DEFAULT NULL,
  `DueDate` date NOT NULL DEFAULT '0000-00-00',
  `SCode` varchar(6) DEFAULT NULL,
  `Amount` double NOT NULL DEFAULT '0',
  `SpDiscount` double NOT NULL DEFAULT '0',
  `TotAmt` double NOT NULL DEFAULT '0',
  `TaxType` ENUM('E','I','N') NOT NULL DEFAULT 'E',
  `Vat` double NOT NULL DEFAULT '0',
  `VatAmt` double NOT NULL DEFAULT '0',
  `NetAmt` double NOT NULL DEFAULT '0',
  `RcvAmt` double DEFAULT NULL,
  `RealRcvAmt` double NOT NULL DEFAULT '0',
  `Remark` varchar(50) DEFAULT NULL,
  `BankCode` varchar(4) DEFAULT NULL,
  `ChqNo` varchar(15) DEFAULT NULL,
  `ChqDate` date DEFAULT NULL,
  `CreditCard` varchar(4) DEFAULT NULL,
  `CardNo` varchar(16) DEFAULT NULL,
  `CardExp` varchar(5) DEFAULT '  /',
  `Status` char(1) DEFAULT NULL,
  `ToAR` ENUM('Y','N') NOT NULL DEFAULT 'N',
  `UID` varchar(10) DEFAULT NULL,
  `UDT` datetime DEFAULT NULL,
  `PayDate` datetime DEFAULT NULL,
  `cancel_b` ENUM('Y','N') NOT NULL DEFAULT 'N',
  `canStaff` varchar(12) DEFAULT NULL,
  `canDate` datetime DEFAULT NULL,
  `CommCutOff` char(1) NOT NULL DEFAULT 'N',
  PRIMARY KEY  (`Code`),
  KEY `cancel_b` (`cancel_b`),
  KEY `UDT` (`UDT`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Transaction Header';

Open in new window

teeraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bobbit31Commented:
ROUND(sellhead, 2)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cornelia YoderArtistCommented:
SELECT `sellhead`.TrnDate, `sellhead`.InvoiceNo, `sellhead`.CName,  ROUND(`sellhead`.
       VatAmt,2), `sellhead`.NetAmt
  FROM AOL.sellhead `sellhead`
 WHERE (`sellhead`.InvoiceNo LIKE '00%') AND Month(TrnDate) = 1 AND Year(TrnDate)=2008
0
hieloCommented:
See code below:
SELECT `sellhead`.TrnDate, `sellhead`.InvoiceNo, `sellhead`.CName, Format(`sellhead`.VatAmt,2)as VatAmount, `sellhead`.NetAmt
  FROM AOL.sellhead `sellhead`
 WHERE (`sellhead`.InvoiceNo LIKE '00%') AND Month(TrnDate) = 1 AND Year(TrnDate)=2008

Open in new window

0
teeraAuthor Commented:
when You round it  the remaining that you round will destroy or it keep

 

`sellhead`.NetAmt -  ROUND(`sellhead`. VatAmt,2)

if the value is   80.123  when round it become  80.12  ,   0.003  will destroy or it keep remaining ven you bring it to caluclate
0
hieloCommented:
That will "loose" .003. YOu need:
ROUND( `sellhead`.NetAmt -  `sellhead`. VatAmt,2)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.