Field VarChar= `Reg_Determinari`.`RH_D - OPTION LIST (Pozitiv;;Negativ;;Incert;;_______;;D Slab)
Field VarChar= `Reg_Determinari`.`D`
Query:
SELECT `Reg_Determinari`.`RH_D`, `Reg_Determinari`.`D`
CASE
WHEN`Reg_Determinari`.`RH_D` = 'Pozitiv' THEN 'D'
WHEN`Reg_Determinari`.`RH_D` = 'Negativ' THEN 'd'
WHEN`Reg_Determinari`.`RH_D` = 'Incert' THEN 'D(incert)'
WHEN`Reg_Determinari`.`RH_D` = 'D Slab' THEN 'D(Slab)'
WHEN`Reg_Determinari`.`RH_D` = '_______' THEN ''
END AS `Reg_Determinari`.`D`
FROM `Reg_Determinari`
WHERE `Reg_Determinari`.`ID`='%ID%'
Case used in SQL Query Any Sugestios?
Re: Case used in SQL Query Any Sugestios?
Hi,
aha, and what is your question, problem, desired result?
Maybe this helps: https://www.mysqltutorial.org/mysql-case-function/ and https://www.w3schools.com/SQL/func_mysql_case.asp
Olaf
aha, and what is your question, problem, desired result?
Maybe this helps: https://www.mysqltutorial.org/mysql-case-function/ and https://www.w3schools.com/SQL/func_mysql_case.asp
Olaf
Some postings I was involved, you might find useful:
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Re: Case used in SQL Query Any Sugestios?
I agree with Olaf: your question is not very clear. I guess you have problems with SQL for a calculated field, right?
SQL query for calculated field should return exactly one value.
PS: please always put code in
SQL query for calculated field should return exactly one value.
Code: Select all
SELECT CASE
WHEN`Reg_Determinari`.`RH_D` = 'Pozitiv' THEN 'D'
WHEN`Reg_Determinari`.`RH_D` = 'Negativ' THEN 'd'
WHEN`Reg_Determinari`.`RH_D` = 'Incert' THEN 'D(incert)'
WHEN`Reg_Determinari`.`RH_D` = 'D Slab' THEN 'D(Slab)'
WHEN`Reg_Determinari`.`RH_D` = '_______' THEN ''
END FROM `Reg_Determinari`
WHERE `Reg_Determinari`.`ID`='%ID%'
[code]...[/code]
-tags for better readability.Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 25.10 + all AppGini Helper tools