On Tue, Jan 27, 2009 at 5:35 AM, Ken Kixmoeller/fh
<[email protected]> wrote:
>>
>> Select
>> Case ColumnOrVariable
>> when ThisCondition then ThisValue
>> when ThatCondition then ThatValue
>> etc. end as MyOutput
>
>
> Yes, that is what I was working on. Here is what I have so far:
>
> CASE
>  WHEN length(address2)=0 AND length(mailcode)=0 THEN address1
>  WHEN length(address2)=0 AND length(mailcode)>0 THEN concat
> (address1,'^',mailcode)
>  WHEN length(address2)>0 AND length(mailcode)=0 THEN concat
> (address1,'^',address2)
>  WHEN length(address2)>0 AND length(mailcode)>0 THEN concat
> (address1,'^',address2,' - ',mailcode)
>  ELSE '' END as `concataddr`,

This statement is just getting one column for your export right?

Take your last when as the else statement before your END.

You also have to string these together (address1,'^',address2,' -
',mailcode) for placement into concataddr.

HTH





> Able to use the length() function for both empty and null data
> conditions, so that shortens it a lot.
>
>> So why didn't you present your VFP code and we would have T-SQLed
>> it for you.
>
> It wasn't VFP; SQL all the way. Sometimes I use VFP to test SQL,
> though. I still find it easier to visualize my data when I actually
> can *see* it. <g> If it was VFP, I'd just RW the cursor and do a few
> replace statements. Ah, well, the statement above wasn't as bad as I
> thought it would be...
>
> Ken
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to