>
> 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`,

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

_______________________________________________
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/4ee5550c-cbec-4532-bdff-20d7f68ac...@information-architecture.com
** 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