Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i have a select like this :
sql select table.name, table.surname, table.age
from table
where table.borndate = vDday
I need vDay loops between 2 values(i.e. 20120101 and sysdate)
Result set will be a list of record for each day
tyvm
Simone
Si ma il formato è DD/MM/YYYY? se è così allora dovrebbe già fiunzionare, altrimenti prova
a girare le date
num(Date#('01/02/2014','DD/MM/YYYY')) in ..... YYYY/MM/DD
Num(Date#(Today(),'DD/MM/YYYY') in YYYY/MM/DD
Dovrebbe andare, fammi sapere
you can try
where borndate = '$(vYourVariable)'
Il formato su db è dd/mm/yyyy
l'errore restituito quando lancio lo script è
ORA-00932: tipi di dati incoerenti: previsto DATE, ottenuto NUMBER
LET myDateIni = Num(Date#('01/02/2013','DD/MM/YYYY'));
LET myDateFin = Num(Today());
FOR i = num(Date#('01/02/2013','DD/MM/YYYY')) to Num(Date#(Today(),'DD/MM/YYYY'))
SELECT * from employee_uo where start_date = $(i);
NEXT
Ciao Simone,
La mia query gira in MSSQL, la tua in oracle, quando ci sono problemi di formato dovuti al DB, fai lavorare qlik, prova a spostare la logica nel load in questa maniera e fammi sapere
FOR i = num(Date#('01/02/2014','DD/MM/YYYY')) to Num(Date#(Today(),'DD/MM/YYYY))
LOAD * where Num(borndate) = $(i);
SELECT * from myTable;
NEXT
continua a darmi errore, con l'ultima soluzione non trova il campo borndate.
sto impazzendo per un cosa che in teoria dovrebbe essere semplice
Grazie
Simone
hi Bill
i tried this way :
FOR i = Date#('01/12/2012','DD/MM/YYYY') to Date#('31/12/2012','DD/MM/YYYY')
SELECT cod_uo, employee_id
FROM employee_uo
WHERE $(i) >= start_date AND $(i) <= expiry_date;
NEXT;
Lookup Error ORA-00932: inconsistent datatypes: expected DATE got NUMBER
SELECT cod_uo, employee_id
FROM employee_uo
WHERE 41244 >= start_date AND 41244 <= expiry_date
Any solution?
tyvm
this works on an oracle dbms
hiredate is a date data type in my table
OLEDB CONNECT32 TO [Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=xxxx;Data Source=xxxxx;Extended Properties=""] (XPassword is xxxxxxxxxxxxx);
LET myDateIni = Num(Date#('01/01/2014','DD/MM/YYYY'));
LET myDateFin = Num(Today());
FOR i = myDateIni to myDateFin
TRACE $(i);
LET d=date($(i), 'DD/MM/YYYY');
trace $(d);
LOAD *;
SQL SELECT * FROM "TEST"."EMP" where hiredate >= to_date('$(d)', 'DD/MM/YYYY');
NEXT
let vint=interval(Date1-Date2,'D')
For i =0 to vint
let Vdate=dayname('Date1',$(i))
SELECT cod_uo, employee_id
FROM employee_uo
WHERE vdate >= start_date AND vdate <= expiry_date;
NEXT
Try below...
sql select table.name, table.surname, table.age
from table
where table.borndate >='$(vDday)' and table.borndate <=Today()
stai confrontando la start_date che sul db oracle è una date con la variabile qlikview che contiene un numero, da cui l'errore oracle, cioè stai eseguendo qualcosa di simile a
SELECT * from employee_uo where start_date = 40000;