Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

How to extract 2 days data from database

Hi Experts,

Can any one please help me on below requirement.

I have a table from SQL database

Here the DATE is in DD/MM/YYYY 00:00:00 format. so extracted date with DD/MM/YYYY using to_char function.

By using where condition I have to extract only 2 days data 02/04/2018 and 03/04/2018 and need to store in one qvd only. By defining static also fine.


i have used like this and extracted one day data using where to_Char(DATE,'DD/MM/YYYY') ='02/02/2018';

how to add 03/04/2018 here. Please help me on this

LOAD

DATE(DATE,'DD/MM/YYYY') as DATE,

TYPE,

STATUS,

SALES,

PRODUCT;

SELECT

to_Char(DATE,'DD/MM/YYYY') AS DATE,

TYPE,

STATUS,

SALES,

PRODUCT

FROM ....

where to_Char(DATE,'DD/MM/YYYY') ='02/02/2018';

1 Solution

Accepted Solutions
Highlighted
Master III
Master III

SELECT

to_Char(DATE,'DD/MM/YYYY') AS DATE,

TYPE,

STATUS,

SALES,

PRODUCT

FROM ....

where to_Char(DATE,'DD/MM/YYYY') Between '02/02/2018' AND '03/04/2018';

View solution in original post

5 Replies
Highlighted

Use in() or between() in where clause

like

select * from tableName

where dateField in ('requiredDate','requiredDate')

or

select * from tableName

where dateField between 'FromDate' and 'toDate'

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Highlighted
Partner
Partner

Hi,

Use where DATE >='02/02/2018' and <='03/02/2018'

Regards

Highlighted
Master III
Master III

SELECT

to_Char(DATE,'DD/MM/YYYY') AS DATE,

TYPE,

STATUS,

SALES,

PRODUCT

FROM ....

where to_Char(DATE,'DD/MM/YYYY') Between '02/02/2018' AND '03/04/2018';

View solution in original post

Highlighted
Master III
Master III

have you got this working?

Highlighted
Creator
Creator

SELECT

to_Char(DATE,'DD/MM/YYYY') AS DATE,

TYPE,

STATUS,

SALES,

PRODUCT

FROM ....

where to_Char(DATE,'DD/MM/YYYY') ='02/04/2018'

OR to_Char(DATE,'DD/MM/YYYY') ='03/04/2018';