Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ANSI SQL Date Calculations against Oracle Rdb data
Message
 
 
À
21/07/1999 17:32:34
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00244314
Message ID:
00244630
Vues:
20
>>>
>>>"WHERE [Date subtraction calculation] <= 18" && Kid is under 18 years old
>>>
>>>- or -
>>>
>>>"WHERE [Date subtraction calculation] <= 90" && Kid is under 90 months old
>>>
>>>I need to do subtraction since I'm looking for kids with the dx in the past 3 years so I need to calculate Dob vs discharge date.

Sorry for the thick-headedness. In Oracle, there is a function called MONTHS_BETWEEN which returns the months between 2 dates --

...where MONTHS_BETWEEN(SYSDATE, DX) <= 18

The order of the dates passed is important because Date2 [DX] is subtracted from Date1 [SysDate].

There is another function called ADD_MONTHS which works exactly the same as VFP's GOMONTH function. The 1st parameter is a date, and the 2nd parameter is the number of months to either add or subtract from the date.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform