0
You can use Mysql Replace
https://www.w3resource.com/mysql/string-functions/mysql-replace-function.php
SELECT <CAMPOS> FROM <TABELA>
WHERE CAST(REPLACE(REPLACE(CAMPO, '.', ''),',','.') as DECIMAL(10,2))
BETWEEN MINIMO AND MAXIMO
0
1
You can use Mysql Replace
https://www.w3resource.com/mysql/string-functions/mysql-replace-function.php
SELECT <CAMPOS> FROM <TABELA>
WHERE CAST(REPLACE(REPLACE(CAMPO, '.', ''),',','.') as DECIMAL(10,2))
BETWEEN MINIMO AND MAXIMO
Browser other questions tagged mysql sql
You are not signed in. Login or sign up in order to post.
What type of field you store the value in?
– Roberto de Campos
You already have a code snippet ?. If yes post there. What basically has to be done is the following:. A javascript function listens to changes in the select field. When this happens she will make a request for a php script that will make the query in the database.
– Atila Silva
The right thing to do is to store the values in the database without this formatting that we use (R$, comma, dot*). The value must be stored in a decimal column. Hence vc will format this value directly in PHP and/or javascript. *Remembering that mysql treats dot as decimal separator. Therefore, R$ 10.99 should be stored simply as 10.99.
– LipESprY
It is a major hassle to store formatted values like this in a database. Consider this to review your implementation logic. If it’s something legacy good luck.
– Atila Silva