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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
RichJ
Contributor III
Contributor III

issues when filtering on date column

Hi there,

I need to filter source data from SQL Server DB on a date column, but got the error:

[SQL Server]The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. Line: 1 Column: -1 [1022502] (ar_odbc_stmt.c:2789)
00014552: 2021-12-16T18:27:54 [SOURCE_UNLOAD ]E: RetCode: SQL_ERROR SqlState: 42000 NativeError: 16945 Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The cursor was not declared. Line: 1 Column: -1 [1022502] 

The filter I used is  "Greater than or equal to >= '2020-01-01 00:00:00.000'",  but it did not work.  Then I tried to use  

CONVERT(datetime'2020-01-01 00:00:00.000') as below:

RichJ_0-1639708684164.png

but when I click the edit, it shows:

RichJ_1-1639708961119.png

Thanks for help,

Richard

2 Replies
john_wang
Support
Support

Hello @RichJ ,

Noticed this article went to wrong area: Qlik Community --> Forums --> Data Analytics --> Qlik Sense --> App Development.

Can you close this one and open a new one in Replicate area? I'd like to help. 

Regards,

John.

 

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
john_wang
Support
Support

Hello @RichJ ,

Not very sure what's the column data type in your expression. I'm using DATE column for example:

create table testdt (id integer not null primary key, name char(20),dt date);

insert into testdt values (2,'A','2021-11-02');
insert into testdt values (4,'B','2021-12-20');

Trying to get the rows which DT greater or equal than 2021-12-01, the screen copy of the demo:

john_wang_0-1640848344982.pngjohn_wang_1-1640848359413.png

 

If you need further assistance, please let me know the SQL how to create the demo table and prepare the demo rows, I'd like to show you how to use the filter.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!