FinanceFerret/2.0/sql/qryCbx Accts: Difference between revisions
< FinanceFerret | 2.0 | sql
Jump to navigation
Jump to search
m (3 revisions imported: stuff I missed the first time) |
(content apparently got lost in export/import; here it is) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==About== | |||
* '''Purpose''': dataset for drop-down boxes | |||
* '''Fields''': | |||
** '''ID''': The way this is generated is a bit of a kluge so that each line's "value" will be unique, even though some lines may have "aliases". The HTML drop-down list control seems to reject duplicate values. Appending the ID of the "alias" to the ID we actually want used gives a unique value per line which can easily be converted to the proper value by taking only the integer part. | |||
* '''History''': | |||
** '''2009-08-30''' Created for web interface version | |||
** '''2018-05-06''' This is no longer being used; SQL now implemented in PHP. | |||
==SQL== | |||
<source lang=mysql>CREATE OR REPLACE VIEW qryCbx_Accts AS | |||
SELECT | |||
CONCAT_WS('.',ID_Alias,ID) AS ID, | |||
Name | |||
FROM Accounts | |||
ORDER BY Name;</source> |
Latest revision as of 13:55, 2 March 2020
About
- Purpose: dataset for drop-down boxes
- Fields:
- ID: The way this is generated is a bit of a kluge so that each line's "value" will be unique, even though some lines may have "aliases". The HTML drop-down list control seems to reject duplicate values. Appending the ID of the "alias" to the ID we actually want used gives a unique value per line which can easily be converted to the proper value by taking only the integer part.
- History:
- 2009-08-30 Created for web interface version
- 2018-05-06 This is no longer being used; SQL now implemented in PHP.
SQL
CREATE OR REPLACE VIEW qryCbx_Accts AS
SELECT
CONCAT_WS('.',ID_Alias,ID) AS ID,
Name
FROM Accounts
ORDER BY Name;