Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

why i must have this line ? Date(Monthstart([date_time]), 'YY MMM') as test1;

Hi All

I have below code which is running fine :-

CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=False;User ID=SA;Initial Catalog=andonDatabas;Data Source=Paul;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=PAUL;Use Encryption for Data=False;Tag with column collation when possible=False];

LOAD

*,

Date(Monthstart([date_time]), 'YY MMM') as test1;

select * from record_produksi_plc;

when i try to remove below code from above :-

Date(Monthstart([date_time]), 'YY MMM') as test1;

I will get error.

what should i do ? if i want to remove above line and not get error ?

Paul

1 Solution

Accepted Solutions
oscar_ortiz
Partner - Specialist
Partner - Specialist

Paul,

Try removing the previous load section, as you are no longer modifying any data coming from the SQL select statement.

You should simply be left with the SQL Select statment.

sql select * from record_produksi_plc;

Good luck

Oscar

View solution in original post

7 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

Can you post your exact code when you remove your line.

you may also have remove ";" or left out "," which will produce error in your script.

Not applicable

Can you post the error here?

oscar_ortiz
Partner - Specialist
Partner - Specialist

Paul,

Try removing the previous load section, as you are no longer modifying any data coming from the SQL select statement.

You should simply be left with the SQL Select statment.

sql select * from record_produksi_plc;

Good luck

Oscar

paulyeo11
Master
Master
Author

Hi Eddie , my error code is below :-

Syntax error, missing/misplaced FROM:

LOAD

*,

select * from record_produksi_plc

LOAD

*,

select * from record_produksi_plc

jpenuliar
Partner - Specialist III
Partner - Specialist III

","

paulyeo11
Master
Master
Author

Thank You very much .

By the way what is the diff  between below 2 line ? when i run it behave the same .

SQL select * from record_produksi_plc;

select * from record_produksi_plc;

oscar_ortiz
Partner - Specialist
Partner - Specialist

There is no difference between the two statements.  The SQL is optional for the Select statement.  For other SQL commands you'll want to include.

The SQL statement allows you to send an arbitrary SQL command through an ODBC or OLE DB connection.

SQL leave;

SQL Execute <storedProc>;

SQL SELECT * from tab1;

SELECT * from tab1;

For consitency purposes I prefer to precede the Select statement with SQL.

Oscar