Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

adoteykwame
Contributor

Load with a where clause

Hi,

The syntax gives an error below

SQL##f - SqlState: S1000, ErrorCode: 4294757240, ErrorMsg: [DataDirect][ODBC OPENEDGE driver][OPENEDGE]Syntax error in SQL statement at or about "DATE(trndat,'dd/MM/yyyy')>= '2010/01/01'" (10713)

SQL SELECT *

FROM PUB.uwm100

/////////////////////////////////////////////////////////////////////////////

load

    a,

    b,

    c,

DATE(trndat,'dd/MM/yyyy') as %DATE;

SQL SELECT *

FROM PUB.uwm100

DATE(trndat,'dd/MM/yyyy')>= '2010/01/01';

1 Solution

Accepted Solutions
adoteykwame
Contributor

Re: Load with a where clause

Hi Guys,

Finally resloved it.

load

    a,

    b,

    c,

DATE(trndat,'dd/MM/yyyy') as %DATE;

SQL SELECT *

FROM PUB.uwm100

WHERE trndat >= ' 31/12/2010;

5 Replies

Re: Load with a where clause

Probably it is

DATE(trndat,'dd/MM/yyyy')>= '01/01/2010';

adoteykwame
Contributor

Re: Load with a where clause

Hi

change the format but the error still persist

Not applicable

Re: Load with a where clause

Hi,

Try with this

LOAD

    a,

    b,

    c,

    DATE(trndat,'dd/MM/yyyy') as %DATE

WHERE trndat >= MakeDate(2010, 1, 1);

SQL SELECT *

FROM PUB.uwm100;

Not applicable

Re: Load with a where clause

Its probably because '2010/01/01' is not treated as date in your database (is it SQL Server/Sybase ?)

You can probably modify your where clause as;

WHERE datediff('2010-01-01', date(trndat,'dd/MM/yyyy')) >= 0

Regards

Vikas

adoteykwame
Contributor

Re: Load with a where clause

Hi Guys,

Finally resloved it.

load

    a,

    b,

    c,

DATE(trndat,'dd/MM/yyyy') as %DATE;

SQL SELECT *

FROM PUB.uwm100

WHERE trndat >= ' 31/12/2010;

Community Browser