Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I wanted to fetch the data from a database table named "table1" which were reported in year 2016
that is from 1st Jan,2016 to till date.
For this ,I am using the below query:
Select * From "table1";
where to_char("Reported_Date",'YYYY')='2016';
But I am getting an error like column not found whenever i put anything (any Function like to_date(), to_char(), Trunc()) before column Name.
Regards,
Anjali Gupta
Try with the following logic -
Select * From Table1
Where Date(Date#(Reported_Date),'YYYY')='2016';
Regards
Nilanjan
Hi Nilanjan,
I am still facing the same issue.
Regards,
Anjali Gupta
Try:
Select * From Table1
Where year(YourDateField)=year(yearstart(today()));
Hi Pravesh,
I tried this also, Any function before the dateField is showing me column not found error.
Regards,
Anjali Gupta
Hi Anjali,
you need to write the column name exactlly, think that QlikView is case sensitive.
Then try this:
LOAD *
WHERE year(Reported_Date)=year(today());
SQL SELECT * FROM Table1;
Regards!!
Have a look at your source data using a debug load (limit 100) to check the column formatting of the date field in question.
TAB:
Load *,Date(Date#(Reporting_Date,'YYYY')) AS Year;
SQL Select * from table1;
Load * Resident TAB where Year = '2016';
Drop Table TAB;