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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sql syntax error

Hi QlikView Friends,

Please help me with this strange issue.

i'm running this syntax in qlikview on oracle database, but gives me error.

SQL SELECT * FROM MSEG WHERE MBLNR IN (SELECT MBLNR FROM MKPF WHERE CPUDT >$(LASTRELOADTIME));


Thanks

vishwaranjan

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Include single quotes for variable names

TableName:

SQL SELECT * FROM MSEG WHERE MBLNR IN (SELECT MBLNR FROM MKPF WHERE CPUDT >'$(LASTRELOADTIME)');


Regards,

jagan.

View solution in original post

14 Replies
sujeetsingh
Master III
Master III

Check for timestamp issue or Variable value?

ajaykumar1
Creator III
Creator III

Hi,

Is single code required?

>'$(LASTRELOADTIME)');


Regards,

Ajay

jagan
Partner - Champion III
Partner - Champion III

Hi,

Include single quotes for variable names

TableName:

SQL SELECT * FROM MSEG WHERE MBLNR IN (SELECT MBLNR FROM MKPF WHERE CPUDT >'$(LASTRELOADTIME)');


Regards,

jagan.

Anonymous
Not applicable
Author

Try this:


SQL SELECT * FROM MSEG WHERE MBLNR IN (SELECT MBLNR FROM MKPF WHERE CPUDT >    '$(LASTRELOADTIME)' );

Not applicable
Author

hi

thanks for response,but i had tried but not get success.

i havve also try according to this

SQL SELECT * FROM MSEG WHERE MBLNR IN (SELECT MBLNR FROM MKPF WHERE TO_DATE(CPUDT ,'DD-MM-YYYY')>'$(LASTRELOADTIME)');

************************************************************************************************

and also try according to this

let  LASTRELOADTIME = date(date#(today()-1,'DD-MM-YYYY'),'DD-MM-YYYY');

let  date_key = 'to_date(CPUDT,'DD-MM-YYYY')';


SQL SELECT * FROM MSEG WHERE MBLNR IN (SELECT MBLNR FROM MKPF WHERE '$(date_key)' >'$(LASTRELOADTIME)');

Thanks

Not applicable
Author

hi sir

your syntax execute successfully. but not compare both date in

WHERE CPUDT >'$(LASTRELOADTIME)');


here fetch all dates of CPUDT


Thanks


jagan
Partner - Champion III
Partner - Champion III

Hi,

Check date format LASTRELOADTIME and CPUDT.

Also use this statement


let  LASTRELOADTIME = date(today()-1,'DD-MM-YYYY');

Regards,

Jagan.

dinuwanbr
Creator III
Creator III

Hi,

Check out this

SQL SELECT * FROM MSEG WHERE MBLNR IN (SELECT MBLNR FROM MKPF WHERE CPUDT >date('$(LASTRELOADTIME)'));


or

SQL SELECT * FROM MSEG WHERE MBLNR IN (SELECT MBLNR FROM MKPF WHERE date(CPUDT) >'$(LASTRELOADTIME)');


BR,

-dinu1

Not applicable
Author

hi sir

thanks for your response, i checked that both format are same as DD-MM-YYYY

problem is that, both date (CPUDT and LASTRELOADTIME ) are not match.