Reputation: 11
i have a tenure field (numeric) on a table representing the number of months a user has been on file. I want to subtract that field from today's date to return the registration date of the user. Any idea how to do this using oracle sql
Upvotes: 0
Views: 83
Reputation: 23588
Something like:
add_months(sysdate, -your_number_of_months_column)
? You may possibly want to use trunc(sysdate).
However, it sounds like a bad design; why is the registration date of the user not stored in its own column? If you select the user's record today, the registration date will be different than if you selected it tomorrow (unless you use trunc(sysdate, 'mm')).
Upvotes: 1