Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
MVP
MVP

Add a preceding Load:

Load *,     

Today() as LoadDate;

SQL SELECT ...

View solution in original post

5 Replies
Highlighted
MVP
MVP

Add a preceding Load:

Load *,     

Today() as LoadDate;

SQL SELECT ...

View solution in original post

Highlighted
MVP & Luminary
MVP & Luminary

Syntax for which database..?

Vizlib Head of R&D
Highlighted
Not applicable

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";

Highlighted
MVP
MVP

What does the error message say?

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

Highlighted
Not applicable

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