>My table contains a list of shows with showtimes (see below).
>cCode cName cDate1, cDate2, cDate3, cDate4, cDate5, cDate6
>
>I want to know how can I offer in a combobox the list of
>dates for a selected show. In other words, I want to transpose
>the columns in rows (like below).
>
>for cCode="ABC" the result must be:
>cDate1
>cDate2
>cDate3
>cDate4
>cDate5
>cDate6
>
>What is the best way to do that?
I would actually normalize the table where you have 1 Date field and have a row for each date available for cCode.
Otherwise, you can try:
select cDate1 cShowDate from table1 where cCode = "ABC" ;
union ;
select cDate2 cShowDate from table1 where cCode = "ABC" ;
union ;
select cDate3 cShowDate from table1 where cCode = "ABC" ;
union ;
select cDate4 cShowDate from table1 where cCode = "ABC" ;
union ;
select cDate5 cShowDate from table1 where cCode = "ABC" ;
union ;
select cDate6 cShowDate from table1 where cCode = "ABC" ;
order by 1
Mark McCasland
Midlothian, TX USA