Search code examples
datesasproc-sqlsql-date-functionssqldatetime

SAS PROC SQL - How to add months to a date


How can I add months to a date? I've tried the function ADD_MONTHS(<my date>, 6) and DATEADD(Month, 6, <my date>) but both functions are not recognized.

What's the correct function to use?


Solution

  • I found an answer in sas community: function intnx()

    proc sql;
        select *,intnx('month',<my_date>, 6) as incdate format=date9. from have;
    quit;