Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning a date
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00503012
Message ID:
00503040
Vues:
16
>>>I am trying to create a cursor by using an sql statement. One of my fields is a function. It sends four dates as parameters to the function. The function analizes the dates to find the lateest date. I need to return this value back to the cursor as a value for this field. Right now I get data mismatch. Please help.
>>
>>If this is not run via SPT, why not just use the MAX() function?
SELECT MAX(date1, date2, date3, date4) AS MaxDate,...;
>>  FROM tablealias...;
>It's not going to work. See my other post.

Saw it and you're right. However, this does work
SELECT MaxDate(date1, date2, date3, date4) AS Latest;
  FROM TableAlias;
  ORDER BY 1;
  INTO CURSOR Foo

FUNCTION MaxDate

  LPARAMETERS date1, date2, date3, date4
  RETURN MAX(date1, date2, date3, date4)
ENDFUNC
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform