Yes, I can use IIF(IIF... if I know the description. But the description can be quite a wide selection.
Anyway, I found the problem with my _GENXTAB.PRG. I need to recompile the GENXTAB.PRG to make it work. Obviously, I have the latest program but not the the latest object code.
I would like to thank all who have tried to help me, especially Carl Warner who has replied several times. Thx.
Tai SC
>Sorry. I was looking at the wrong data (asuming that size was size_desc).
>
>If I'm understanding this correctly, you can either have 2 select commands, using integrated if (IIF()) statements -- Like IIF(Size ="XS",1,IIF(Size ="S",2,IIF(Size ="M",3,IIF(Size="L",4,IIF(Size ="XL",5,0))))) AS Size_numb, then doing another select, or integrating that long integrated if clause into your one select command.
>
>JR
>
>>Following your suggestion, I change my data in my size_desc to numbers and select VAL(SIZE_DESC) as the third field. It works. It just shows that there is something wrong with my FPW26 but it doesn't help me. I need a character description.
>>
>>
>>Tai SC
>>
>>>TRY VAL(Size_desc)
>>>
>>>JR
>>>
>>>>I have a table 'SIZE' with structure as follow:
>>>>
>>>>CODE C(10),
>>>>SIZE C(1),
>>>>SIZE_DESC C(10)
>>>>
>>>>A sample set of data is shown below:
>>>>
>>>>CODE SIZE SIZE_DESC
>>>>
>>>>001 1 S
>>>>001 2 M
>>>>001 3 L
>>>>002 1 M
>>>>002 2 L
>>>>003 1 XS
>>>>003 2 S
>>>>003 3 L
>>>>
>>>>
>>>>I need to report the data into the following way:
>>>>
>>>>CODE 1 2 3
>>>>
>>>>001 S M L
>>>>002 M L
>>>>003 XS S L
>>>>
>>>>How do I do this? If the 'SIZE_DESC' is numeric, I can do 'SELECT SUM(IIF(SIZE='1',SIZE_DESC,"") AS DESC1, .... GROUP BY CODE....'. But it is a character field, how do I do it?
>>>>
>>>>Thanks in advance.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement