Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

markgraham123
Contributor II

missing expression from SQL

Hi all,

I'm trying to fetch the records which were greater than 10/28/2015 05:10:55 PM from SQL through qlikview script.

I have field "Last updated Date time" which holds that value.

But when i use,

SQL SELECT

*  

FROM  Table WHERE DATETIME(LAST_UPDATE_DATETIME) >='10/28/2015';

It's throwing "missing expression from SQL" error.

Can some one please help me to get into the right format.

1 Solution

Accepted Solutions
MVP
MVP

Re: missing expression from SQL

Your error says you're using an Oracle database;

but in Oracle I don't find a datetime function SQL Functions

maybe this if LAST_.... is a date

WHERE LAST_UPDATE_DATETIME >= to_date('28/10/2015', 'DD/MM/YYYY')

or

WHERE LAST_UPDATE_DATETIME > to_date('28/10/2015 00:00:00', 'DD/MM/YYYY HH:MISmiley FrustratedS')

38 Replies
sinanozdemir
Valued Contributor III

Re: missing expression from SQL

Are you using SQL Server? If so, the query should be like the below:

SQL SELECT

FROM  Table WHERE LAST_UPDATE_DATETIME >='2015-10-28';

MVP
MVP

Re: missing expression from SQL

The function (datetime, ....) and format ('10/28/2015') after the SQL depends on the database, not QlikView;

what's the database?

markgraham123
Contributor II

Re: missing expression from SQL

Maxgro,

It's SQL

markgraham123
Contributor II

Re: missing expression from SQL

I tried that too bro.

But no luck, same error.

handry_orozco
New Contributor III

Re: missing expression from SQL

Try,

Select *

From Table Where DateTime(Cast(Last_Uptdate_Datetime) As Date) >= '10/28/2015'

Bye

markgraham123
Contributor II

Re: missing expression from SQL

SQL##f - SqlState: S1000, ErrorCode: 936, ErrorMsg: [Oracle][ODBC][Ora]ORA-00936: missing expression

markgraham123
Contributor II

Re: missing expression from SQL

SQL##f - SqlState: S1000, ErrorCode: 936, ErrorMsg: [Oracle][ODBC][Ora]ORA-00936: missing expression

Not applicable

Re: missing expression from SQL

Graham,

Can you add Attribute names after your select statement & check this link.

https://community.qlik.com/thread/61385

Thanks

Brad.

markgraham123
Contributor II

Re: missing expression from SQL

I tried that after checking that thread this morning
but no progress

Community Browser