Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incremental Load issue

Hi Everyone,

                I am getting error at the last line( Where Condition Load_Date>=$(VbuiMstr)),

Any suggestions would be greatly appreciated.

D_GIS_BUILDING_MSTR:
LOAD COMPANY_CODE,
OFFICE_CODE,
CITY_CODE,
OFFICE_NAME,
Date(Load_Date) as Load_Date ,
Load_DateTime
FROM
[..\Data Sources\Master\D_GIS_BUILDING_MSTR.qvd]
(
qvd);

LET VbuiMstr=Peek('Load_Date',0,'D_GIS_BUILDING_MSTR');
//Let Vtodayt=Today()-1;

Incr_D_GIS_BUILDING_MSTR:
NoConcatenate
SQL SELECT *
FROM HRAnt.dbo."BUILDING_MSTR" where COMPANY_CODE='C002' and Load_Date>=
$(VbuiMstr);

Thanks in Advance

Regards,

P.Divya

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

You should format the date field to match what your database expects in a date. And enclose in single quotes. Something like

LET VbuiMstr = Date(Peek('Load_Date',0,'D_GIS_BUILDING_MSTR'), 'DD-MM-YYYY');


(adjust the format string to your requirements)


Your screenshot is too small to be able to read the error message.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

9 Replies
tresesco
MVP
MVP

Try with single quotes around dollar expansion like:

Load_Date>='$(VbuiMstr)' ;

Not applicable
Author

Hi tresesco,

Thanks for quick response,I tried with single quotes ,but still it is giving error

Not applicable
Author

Hi ,

Please find below screenshot for your reference

jonathandienst
Partner - Champion III
Partner - Champion III

You should format the date field to match what your database expects in a date. And enclose in single quotes. Something like

LET VbuiMstr = Date(Peek('Load_Date',0,'D_GIS_BUILDING_MSTR'), 'DD-MM-YYYY');


(adjust the format string to your requirements)


Your screenshot is too small to be able to read the error message.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi ,

PFA

tresesco
MVP
MVP

ODBC fail. Have you tried without this where clause, is that working?

jonathandienst
Partner - Champion III
Partner - Champion III

That looks like a login/permissions issue.

I suggest that you test the ODBC connection again. In the script editor, just create a new ODBC connection and click the test option (delete the newly created connection when done)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
prashantbaste
Partner - Creator II
Partner - Creator II

Hi,

Please check with below code -

//-------------------------------------------------------------------------

D_GIS_BUILDING_MSTR:
LOAD COMPANY_CODE,
OFFICE_CODE,
CITY_CODE,
OFFICE_NAME,
Load_Date as Load_Date ,
Load_DateTime
FROM
[..\Data Sources\Master\D_GIS_BUILDING_MSTR.qvd]
(
qvd);

LET VbuiMstr=Peek('Load_Date',0,'D_GIS_BUILDING_MSTR');
//Let Vtodayt=Today()-1;

Incr_D_GIS_BUILDING_MSTR:
NoConcatenate
SQL SELECT *
FROM HRAnt.dbo."BUILDING_MSTR" where COMPANY_CODE='C002' and Load_Date>=
$(VbuiMstr);

//-------------------------------------------------------------------------


There is possibility of datatype mismatch in database field & value stored in variable. Better not to format field.


Please check & confirm if it resolves your query.


--

Regards,

Prashant  P Baste

Not applicable
Author

Hi tresesco,

Your information is also very helpful.Thanks for your Valuable information.

Regards,

P.Divya