Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sculptorlv
Creator III
Creator III

SQL Where Date ....

Hello again.

I have a lot of records with dates.

How can I in SQL make a selection in order to get records only with the date of previous month?

For example,  now GetDate() = 21.01.2016 ...

          So I need all records from December of year 2015.

How to make necessary WHERE selection?

WHERE Record_date.... ???

P.S.: I use MS SQL

Thank you in advance for helping!

22 Replies
sinanozdemir
Specialist III
Specialist III

It seems like I am a bit late, but this is what I use:

Capture.PNG

tamilarasu
Champion
Champion

If you use Qlikview function in SQL statement, you will get the message. You should have try exactly what I have suggested. I just created variables above the Sql statement and used the variable names alone in the Sql statement. Anyways, you find the solution.

sculptorlv
Creator III
Creator III
Author

Thank for your help. I did my sql request already. Very similar way.