Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I NEED HELP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00471821
Message ID:
00472306
Vues:
42
Ed,

I have proposed the idea(somethindg like), but not the entire solution.
Let us suppose the table contains three date1,date2,date3 and related 'inds'.
What I ment is:

sele ;
iif(data1=max(date1,date2,date3),ind1,;
iif(data2=max(date1,date2,date3),ind2,ind3)) as ind;
from (yourtable);
where ind1==ind2 or ind1==ind3 or ind2==ind3

The same could be done wirh compare sign '>'.
Yes, I agree, that I should give more details.


<<<<<<<<<<<<>Something like this:
>
>sele ;
> iif(date1>date2,ind1,ind2) as ind;
> from (yourtable);
> where ind1==ind2
>

Given this, the compare doesn't matter at all:

SELE ind1 AS ind FROM (yourtable) WHERE ind1==ind2

>
>>>>>>>>>>>>Your message below
>I cant figure out how to do this. I have a table which looks like:
>
>
>proc_code ind1 val1 date1 ind2 val2 date2 ind3 val3 date3
>--------------------------------------------------------------------------
>000000001 A 102 10/11/99 A 155 04/02/01 Y 155 05/16/98
>000000002 C 865 02/19/98 W 251 03/12/00 K 157 12/12/98
>
>
>What I need to do, is when the IND value repeats in any of the other
>IND columns on the SAME record, get the VAL value for the latest date.
>
>In the above example, this would mean that on the first record, I would
>get back the VAL2 value of 155, because the IND "A" repeats and Date2
>is the greatest date.
>
>On record 2, the IND does not repeat, so ignore the record.
>
>Anyone have any ideas?
EMail: EdR@esolserv.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform