Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I just have a small question, and I am sure its super easy to do but I can't figure this out for hours and looked at a lot of posts. I was wondering it it was possible to combine two or three fields in a list box? I am currently connected to a database and I have survey list box with fields like (GOOD, BAD, DO NOT WISH TO ANSWER, NO RESPONSE, BLANK) and I wanted to combine DO NOT WISH TO ANSWER, NO RESPONSE AND BLANK into one field called name such as NOT RATED. I just want some guidance or direction on where or how I should accomplish this? Sorry if this is a repeated question I have search for hours trying to find the answer on the forums. Any help is much appreciated
Thanks
Cliff
The way I describe above will give you the result you wish using QV.
Otherwise, use CASE in SQL statement to do it.
Select
(CASE WHEN survey='DO NOT WISH TO ANSWER' THEN 'Not rated'
WHEN survey='NO RESPONSE' THEN 'Not rated'
etc
ELSE 'Rated' END) as survey
SQL Server syntax
Hi,
How is your data arranged? I'd add a calculated field to your load script if they are all on the same table.
Chris
LOAD * INLINE [
RATE, RATE_TYPE
DO NOT WISH TO ANSWER, NOT RATED
GOOD, RATED
BAD, RATED
NO RESPONSE, NOT RATED
BLANK, NOT RATED
];
AND USE RATE TYPE IN A LIST BOX
Note that RATE must have the same field name as in your original data.
Hey Chris,
I have loaded by data from an SQL datebase, I have a column in Table1 in SQL called survey, which has good, bad, do not wish to answer, no response and blank. In my script, I load this data information using
SQL SELECT survey
FROM Table1
GROUP BY survey
and then there is a list box which contains all those fields. I'd like add do not wish to answer, no response and blank into one field called Not rated
Cliff
The way I describe above will give you the result you wish using QV.
Otherwise, use CASE in SQL statement to do it.
Select
(CASE WHEN survey='DO NOT WISH TO ANSWER' THEN 'Not rated'
WHEN survey='NO RESPONSE' THEN 'Not rated'
etc
ELSE 'Rated' END) as survey
SQL Server syntax
Thanks giakoum got it to work the way I wanted I used the CASE statement
much appreciated.
Cliff