Discussion Board for collaboration on QlikView Scripting.
I'm stuck with a problem.
I want to use the current date (7-4-2014) in my SELECT statement.
Code,Count(Code) as aantal,CurrentDate() as afldatumFROM DATASTORE.dbo."DS_ORDRS"
WHERE Code not in (0,99)
I have searched on the internet to find the solution, but all I can find is how to use date outside QV script, or in the WHERE statement in SQL script.
Anyone know how I can solve this?
Today() as afldatum,
Count(Code) as aantal
Group By Code;
That's not working.
It gives me an error of incorrect syntax (no FROM after the first LOAD?)
I tried to give only the important part of the statement, but maybe that's confusing. So this is the whole SQL SELECT:Today() doesn't work in SQL, so how can I put today's date on the 7-4-2014 line?
SQL Select Zuil,Code,Count(Code) as aantal,'7-4-2014' as afldatumFROM DATASTORE.dbo."DS_ORDRS"Where Code not in (0,99)and right (Zuil,1) in (3,7)group by Zuil, CodeOrder by Zuil, Code;
PS: This works. But I need a dump every day, so that's why I need a funtion as Today()
if you want current date (and / or time) in sql please let we know for which database
sql server --> getdate()
oracle --> sysdate
I use the OLE DB Connect in Qlikview.
try preceding load of data with 'where' in 2. load
Date(F1_Date) as DATE_NEW,
Load * Inline
I just want to use the current date of today.
I'm loading from my DB and I want to add a column with the current date.
This script will load every day and will be stored into a QVD file with use of the CONCATENATE function.
Ravis code works.
"Today() doesn't work in SQL, so how can I put today's date on the 7-4-2014 line?"
Look at his example again:
Today() is called in the LOAD section, NOT in the SQL SELECT section.
Count(Code) as aantal
the script below get values from today only.
you get the dimension DATE_Today with current date.
then load the qvd und concatenate with preceding load [ValueToday]
Thanks for all the help guys.
I found a different solution on the community, using a variable in the SQL statement.
So I didn't check the last two solutions.
This is the solution I used.
Let vToday = Today();SQLSelect Zuil,Code,Count(Code) as aantal,'$(vToday)' as AflDatFROM DATASTORE.dbo."DS_ORDRS"Where Code not in (0,99)and right (Zuil,1) in (3,7)group by Zuil, CodeOrder by Zuil, Code;