Hi,
I wanted to add one day into a date and it returned 1 day plus 15 years.
For example:
add one day to 11-DEC-2005, it return 12-DEC-2020. Please help. I am waiting for the solution. Thank you very much in advance.
Below is my Function:
*********************************************************
static void add_one(void)
{
memset(new_eff_date,0,sizeof(new_eff_date));
strcpy(new_eff_date,""
;
EXEC SQL DECLARE add_one_cursor CURSOR FOR
SELECT TO_CHAR(TO_DATE(:cur_nbrjobs_effective_date)+ 1,'DD-MON-RRRR') or use format ("DD-MON-YYYY')
FROM DUAL;
EXEC SQL OPEN add_one_cursor;
POSTORA;
EXEC SQL FETCH add_one_cursor INTO
:new_eff_date:Ind_01;
POSTORA;
if ( NO_ROWS_FOUND )
printf("\nthe new eff date error."
;
EXEC SQL CLOSE add_one_cursor;
POSTORA;
}
|