Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

DATEADD(m, -1,getdate()) in Qlikview

Can't seem to find the anser to this...

Any one know the QV syntax for Sql Server's DATEADD(m, -1,getdate())... ie today's date minus one month???

Thanks, Mike

1 Solution

Accepted Solutions
Not applicable
Author

Try this Addmonths(Date,-1)

-Sridhar

View solution in original post

4 Replies
Not applicable
Author

Try this Addmonths(Date,-1)

-Sridhar

Not applicable
Author

Thanks Sridhar...

By the way... how did you know that??? I couldn't find anything online / in the reference pdf / in the community...

This community is great but I'm desperate for a decent QV Bible to be published!

Cheers again... Mike

Not applicable
Author

Mike, You could get this in this forum itslef. This has been discussed many times in this forum and other sources would be reference manual and Qlikview Help. Below is the content copied from Qlikview Help.


AddMonths(startdate, n , [ , mode] )

Returns the date occurring n months after startdate or, if n is negative, the date occurring n months before startdate.

By specifying a mode (0 if omitted) the date is set to either the unmodified day of the specified month (mode=0) or the calculated day as derived from the end of the month (mode=1).

Examples:

addmonths ('2003-01-29',3) returns '2003-04-29'

addmonths ('2003-01-29',3,0) returns '2003-04-29'

addmonths ('2003-01-29',3,1) returns '2003-04-28'

addmonths ('2003-01-29',1,0) returns '2003-02-28'

addmonths ('2003-01-29',1,1) returns '2003-02-26'

addmonths ('2003-02-28',1,0) returns '2003-03-28'

addmonths ('2003-02-28',1,1) returns '2003-03-31'

Not applicable
Author

Great - It never even crossed my mind to look in help when I need help...    nice one thanks...