Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Adding a Date to a SQL Select


Hello All,

I am using a SQL Select * from MyView into a resident table.  While doing the select, I would like to add a date column to the table (not supplied in the view) to indicate the load date of the record set.  This may sound simple, but I'm having trouble finding the right syntax.

1 Solution

Accepted Solutions
MVP
MVP

Re: Adding a Date to a SQL Select

Add a preceding Load:

Load *,     

Today() as LoadDate;

SQL SELECT ...

5 Replies
MVP
MVP

Re: Adding a Date to a SQL Select

Add a preceding Load:

Load *,     

Today() as LoadDate;

SQL SELECT ...

MVP
MVP

Re: Adding a Date to a SQL Select

Syntax for which database..?

Not applicable

Re: Adding a Date to a SQL Select

Thanks for your response.  I tried your suggestion and the script threw an error.  Here is the statement.  The sql select statement by itself runs fine.

 

TestTable:

Load *,
Today() as LoadDate;
SQL SELECT *
FROM myDB.DBO."MyViewName";

MVP
MVP

Re: Adding a Date to a SQL Select

What does the error message say?

Your DB table does not also have a field named LoadDate, of course.

Not applicable

Re: Adding a Date to a SQL Select

My mistake.  I had a bad line above this one (copy / paste error).  Everything is ok.  Thanks again for your help.

Community Browser