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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where clasue for range values

Hi , I would like to get data between '2015001' and '2015012' from data base,,, what would be the best way to write it in where clause.

As you see I am using MATCH statement, but I think it can be written in a better way

SQL

SELECT * FROM /BIC/AO2HIPLPA00 //$(vTable)
  WHERE MATCH (FISCPER, '2015001','2015002','2015003','2015004','2015005','2015006','2015007','2015008','2015009','2015010','2015011','2015012') // $(Period) // 001/2015 012/2015
AND DISTR_CHAN = '99'

5 Replies
Roop
Specialist
Specialist

Replace the where statement with:

where FISCPER >= '2015001'  and FISCPER <= '2015012'  AND DISTR_CHAN = '99'

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try where FISCPER between '2015001' and '2015012'


talk is cheap, supply exceeds demand
Not applicable
Author

I would like to include both ends  so can it be FISCPER >= '2015001' and FISCPER <= '2015012' 

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

WHERE date >= '2015001' AND

               date <= '2015012'

buzzy996
Master II
Master II

I preferred Gysbert approach.