Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
baarathi
Creator III
Creator III

Loading past 10 months data

Load *;

SQL Select *

from DM.Da

Where monthstart(CreatedDate,'YYYY-MM-DD')  >= Date(monthstart(dateadd(month,-10,Today(),'YYYY-MM-DD'));

this statement throws an error, monthstart is not avaible in sql server. How can i load data for past 10 months ?

12 Replies
YoussefBelloum
Champion
Champion

Yes I know.. I don't have a running SQL database to make the tests for you..

JustinDallas
Specialist III
Specialist III

Will something like this work?

Load *;

SQL Select *

from DM.Da

Where CreatedDate > DATEADD(mm, DATEDIFF(mm, 0,

DATEADD(month,-10,GetDate())),

0)

Month start in SQL Server 2005 - Stack Overflow

Michael_Tarallo
Employee
Employee

Hi Baarathi - I see you are in capable hands. Thanks for tagging me.

Regards,
Mike Tarallo
Qlik