Hi!
I have a date column in my database (suppose start date) which I have to use for calculating other dates (suppose the calculated dates columns are x, y and z). To do this I used the DateAdd function and the results were good. But now based on different conditions (suppose there are 4 different scenarios; 1, 2 ,3 and 4) some of the calculated date fields are "NA".
For eg: for scenario 2 , 3 the columns x and y are "NA" but have the dates for 1 and 4.
The example code i used was:
select *, dateadd ("d", 5, "start date") as x , dateadd ("d", 10, "startdate") as y, dateadd ("d", 15, "startdate") as z
from database;
i dont know how to add the case (when, then) function with this code.
I would really appreciate your advice.
Thanks a lot
I have a date column in my database (suppose start date) which I have to use for calculating other dates (suppose the calculated dates columns are x, y and z). To do this I used the DateAdd function and the results were good. But now based on different conditions (suppose there are 4 different scenarios; 1, 2 ,3 and 4) some of the calculated date fields are "NA".
For eg: for scenario 2 , 3 the columns x and y are "NA" but have the dates for 1 and 4.
The example code i used was:
select *, dateadd ("d", 5, "start date") as x , dateadd ("d", 10, "startdate") as y, dateadd ("d", 15, "startdate") as z
from database;
i dont know how to add the case (when, then) function with this code.
I would really appreciate your advice.
Thanks a lot