General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>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?
>
>When I have a date parameter for an ORacle retrieval, I have to convert the date to with dtoc() function first:
>
>local cDate
>cDate = dtoc(somedate)
>
>My remote view SQL looks like:
>
>...where Ora_DateField = ?cDate and ...
>
>My SQL Passthru construction would be:
>
>"... where Ora_DateField = '" + cDate + "' and ..."
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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only