sql - How to get 6 months from a parametrized date -


i have clause trying date within range parameters so,

 (al.inserted_date between (:begindate) , (:enddate)) 

the problem need 6 months before begin date error, ora-00904: "dateadd": invalid identifier, when try,

 (al.inserted_date between dateadd(month,-6,(:begindate)) , (:enddate)) 

can point me out doing wrong?

you're not using sql server, you're using oracle - that's why it's giving error in oracle format.

http://psoug.org/definition/add_months.htm

add_months best equivalent you're trying here -

  (al.inserted_date between add_months((:begindate),-6) , (:enddate)) 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -