Re:IF THEN Capabilities 13 Years, 2 Months ago
|
Karma: 0
|
I was hoping to show V# in one column, justified right, and then the A# in the next column justified left.
Thanks,
Gorden
|
|
|
|
|
Re:IF THEN Capabilities 13 Years, 2 Months ago
|
Karma: 760
|
Could you specify what problem you have with the next SQL query?
Code: |
SELECT
OUI.factory,
OI.part,
OUI.factory2,
OUI.series,
OUI.power,
OUI.convection,
OUI.type,
CONCAT(
IF(LENGTH(IFNULL(OI.V1, '')) > 0, CONCAT(OI.V1, '<br/>'), ''),
IF(LENGTH(IFNULL(OI.V2, '')) > 0, CONCAT(OI.V2, '<br/>'), ''),
IF(LENGTH(IFNULL(OI.V3, '')) > 0, CONCAT(OI.V3, '<br/>'), ''),
IF(LENGTH(IFNULL(OI.V4, '')) > 0, CONCAT(OI.V4, '<br/>'), '')
) AS V,
CONCAT(
IF(LENGTH(IFNULL(OI.A1, '')) > 0, CONCAT(OI.A1, '<br/>'), ''),
IF(LENGTH(IFNULL(OI.A2, '')) > 0, CONCAT(OI.A2, '<br/>'), ''),
IF(LENGTH(IFNULL(OI.A3, '')) > 0, CONCAT(OI.A3, '<br/>'), ''),
IF(LENGTH(IFNULL(OI.A4, '')) > 0, CONCAT(OI.A4, '<br/>'), '')
) AS A,
OI.Efficiency,
OUI.dimensions
FROM
jos_part OI INNER JOIN jos_series OUI
ON OI.series = OUI.series
WHERE
OI.V2 > 0
AND
OUI.type = 'Open Frame'
AND
OUI.safety = ''
|
Regards,
ARI Soft
|
|
|
|
|
Re:IF THEN Capabilities 13 Years, 2 Months ago
|
Karma: 0
|
I have created separate tables for single output models (V1 has a vaue, V2, V3, V4 do not) So I am now trying to make a table to display multi output models, this table will always have a V1 and V2 value, as well as their mating A1 & A2 value.
So in reality, I only need this display / don't display function for V3 & V4 / A3 & A4. My intent is to display V#'s in one column, and A#'s in another column.
V# Values are followed by a V if they exist, A# Values are followed by an A if they exist.
Please provide an example using the code I started with, when I tried to implement with the syntax you provided, i could not get it to work.
Thank you,
Gorden
|
|
|
|
|
Re:IF THEN Capabilities 13 Years, 2 Months ago
|
Karma: 0
|
To insert the V and A Values, this is the syntax I ended up using and it works perfectly.
SELECT
OUI.factory,
OI.part,
OUI.factory2,
OUI.series,
OUI.power,
OUI.convection,
OUI.type,
CONCAT(
IF(LENGTH(IFNULL(OI.V1, '')) > 0, CONCAT(OI.V1, 'V <br/>'), ''),
IF(LENGTH(IFNULL(OI.V2, '')) > 0, CONCAT(OI.V2, 'V <br/>'), ''),
IF(LENGTH(IFNULL(OI.V3, '')) > 0, CONCAT(OI.V3, 'V <br/>'), ''),
IF(LENGTH(IFNULL(OI.V4, '')) > 0, CONCAT(OI.V4, 'V'), '')
) AS V,
CONCAT(
IF(LENGTH(IFNULL(OI.A1, '')) > 0, CONCAT(OI.A1, 'A <br/>'), ''),
IF(LENGTH(IFNULL(OI.A2, '')) > 0, CONCAT(OI.A2, 'A <br/>'), ''),
IF(LENGTH(IFNULL(OI.A3, '')) > 0, CONCAT(OI.A3, 'A <br/>'), ''),
IF(LENGTH(IFNULL(OI.A4, '')) > 0, CONCAT(OI.A4, ' A'), '')
) AS A,
OI.Efficiency,
OUI.dimensions
FROM
jos_part OI INNER JOIN jos_series OUI
ON OI.series = OUI.series
WHERE
OI.V2 > 0
AND
OUI.type = 'Open Frame'
AND
OUI.safety = ''
Thanks for all the help, I highly recommend this module and your support.
Gorden
|
|
|
|
|
|