It's interesting that the Date type in Oracle while handled as a single entity but is stored internally as seven bytes. One byte each for year, month, day, hour minute, second and fraction of a second.
It's a space waster, but oh so fast to calculate with.
Timestamp on the other hand is stored as a floating point to save space.
You could try and merge DATE_CREATED and TIME_CREATED to get a DATETIME value then you could use between.
Something like (most likely will not work as written):
(Date_Created + Time_Created) BETWEEN @startdatetime AND @enddatetime
Just throw the exception.
There is no reason, I can think of, that you should need to catch an exception from a stored procedure.
Throwing the exception will allow the developer to have an error message and pursue fixing the error.
“That which can be asserted without evidence, can be dismissed without evidence.”
The employee contract can be definite (with expiry date) or indefinite (open without expiry date).
The employee contract will always have date of join
if the contract is definite then employee will have 30 days every year where the year is the period between the date of join and +365 days and the renewal is the same (from the renewal date and +365)
if the contract is indefinite then employee will have 30 days every year where the year is the period between the date of join it's every 365 days so the contract has not renewal but the employee will have 30 days annually.
for example, if indefinite and date of join is 1 April 2010 then every period from 1 April until 30 March will have 30 days for the employee
I want to calculate the leaves for the employee without having to keep a renew table so it will be calculated based on the leave date and the first date of join.
I have HTML content in string variable (from to ) within store procedure. The html contains one table with 'n' number of rows and columns. Its my final output which i will publish in mail.
My need is : I want to workout on last column in this HTML, and highlight background with RED color whichever SLA missed (As my last column having date and want to highlight entries less than today's date)