Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ANSI SQL Date Calculations against Oracle Rdb data
Message
From
21/07/1999 17:32:34
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00244314
Message ID:
00244406
Views:
12
>>>>I'm having trouble retrieving data from an Oracle Rdb database where a date calculation is involved (eg dDischargeDate - dDob <= 18 years).
>>>>
>>>>I have very little documentation about Rdb. Please note that Rdb is a step-child of Oracle so make no Oracle assumptions!
>>>>
>>>>Is it possible to subtract 2 dates in ANSI SQL92 and get a number of days, months, or years? What is the syntax?
>>>


>>Good advice, but I need the ANSI SQL92 SPT syntax for date subtraction:
>>
>>"WHERE <= 18" && Kid is under 18 years old
>>
>>- or -
>>
>>"WHERE >>
>>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.
>
>dDate = gomonth(date(), -216) && subtract 216 months from today
>
>... where Ora_DateField >= dDate

Mark, I need to retrieve discharges during the past 3 years where the patient was under 18 at the time of the discharge. So, I want to calculate _on the server_ the dob vs discharge date.

But I don't know the ANSI SQL92 syntax to do this calculation on the server. Alas, SQL92 is cryptic and doesn't have any "nice" date functions.

Otherwise, what I have done (for now) is bring back all discharges and use Fox functions locally to delete the ones I don't need.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform