I think I am doing everything fine, but I am getting an error… don’t know why…
I have a DOB (Date of Born) of all my employees in the field “FechaNac”
Okay, I want to do something very simple, I want to add to that date, 60 days… so I use the DATEADD() function…
What I do is this simple code in HSQLDB…
DATEADD( “DAY”, 60, “FechaNac” ) AS “SumaDiasFecha”
I select the field, then I use the function DATEADD as it is specified in SQL, DATEADD(datepart,number,date).
Datepart could be year, month, day, etc…
Then the quantity to add…
Then the datefield that is involved in the calculation, in this case we are adding 60 days to the Date of Born of the employees, so “FechaNac”
And then I want to present the results with the Alias “SumaDiasFecha” translated to english would be “AddDaysToDate”
Okay, I get an error that says “Access denied”…
SQL Status: S1000
Error code: -33
Access is denied: DATEADD in statement [SELECT “FechaNac”, DATEADD( ‘day’, 10, “FechaNac” ) “SumaDiasFecha” FROM “tbl_EMPLEADOS”]
How may I solve this?
Could you give me please an example code that be working?