Bug #12664 Format(X,D) function doesn't allow Table's Field as Parameter
Submitted: 19 Aug 2005 4:31 Modified: 10 Oct 2019 21:40
Reporter: RaguNathan T Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:5.0.7-beta-pro-nt OS:Windows (WIndows XP)
Assigned to: CPU Architecture:Any

[19 Aug 2005 4:31] RaguNathan T
Description:
Hi,
I'm developing a Inventory system. In this various types of products will come. Each may have different type of "Unit Of Measure". so the I introduced "NoOfDecimals" in Productmaster Table and the same in ProductTransactions Table. 
I'm Using the Following Query to retieve the records from DB.

"select Format(QuantityIn,3) from producttransactions"

This works fine. But Following doesnt work.

"select Format(QuantityIn,NoofDecimals) from producttransactions"

I'm recived a Error Number 1064. Normally this type of queries will solve many problems if the feature will implement

How to repeat:
Hi,
I'm developing a Inventory system. In this various types of products will come. Each may have different type of "Unit Of Measure". so the I introduced "NoOfDecimals" in Productmaster Table and the same in ProductTransactions Table. 
I'm Using the Following Query to retieve the records from DB.

"select Format(QuantityIn,3) from producttransactions"

This works fine. But Following doesnt work.

"select Format(QuantityIn,NoofDecimals) from producttransactions"

I'm recived a Error Number 1064. Normally this type of queries will solve many problems if the feature will implement
[20 Aug 2005 7:11] RaguNathan T
This will help if you are doing multiple type of products. Example is "TShirts"
will go by Pieces. They will not use the decimals. But "Chemicals","Yarn" will
use the Decimals. so the format() will play a vital role here. I'm looking for
this function for my report.
[28 Apr 2008 17:32] Sveta Smirnova
Thank you for the reasonable feature request.

select format(field, @foo) doesn't work either.
[30 Sep 2008 14:24] Konstantin Osipov
WL#3809 Add expressions where possible, e.g. in LIMIT
[16 Oct 2008 9:18] Sveta Smirnova
Bug #40071 was marked as duplicate of this one.
[10 Oct 2019 21:40] Roy Lyseng
Posted by developer:
 
Implemented in 5.7 (or earlier)