Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to query a postgres database to load a table. I need to make the query dinamic. For Example, a simple query would look like this:
SELECT *
FROM table1
WHERE date(reportdate) = '2012-07-16'
I want to feed the date '2012-07-16' in WHERE statement above using today() function in the qlikview. So I need to convert the result of the Today() function in a string which looks like '2012-07-16'. so that i can write above query as:
SELECT *
FROM table1
WHERE date(reportdate) = $(vdate)
in this query $(vdate) should produce '2012-07-16'. How can i do that?
PPS - I forgot the closing Chr(39)...
Let vDate = Chr(39) & Date(Today(),'YYYY-MM-DD') & Chr(39);
(been a long day..)
Above the load portion of the scrip put:
Let vDate = Chr(39) & Date(Today(),'YYYY-MM-DD');
Then use the SELECT statement exactly as you write above.
Hope this helps,
Jason
PS - the 'amp;' is my iPhone playing silly buggers....
PPS - I forgot the closing Chr(39)...
Let vDate = Chr(39) & Date(Today(),'YYYY-MM-DD') & Chr(39);
(been a long day..)
This worked. Thank you. Have a good one.