Sql problem

Hi,

i’ve got an SQL problem with the use of a field from another dataset. I’ve confirmed the right field is choosen and running the SQL querie in phpMyAdmin does give me the right dataset.

The sql statement is like :

select * from ing where (CAST(’" . ($my_data -> fields[2]) . “’ AS DATE) between fromd and toda)”;

the error = Undefined property: grid_ing_test_apl::$my_data_erro

What could be wrong?

Regards and thanks in advance

Erwin

The best way it to look at the generated code to see what’s wrong. The sql parser in scriptcase sometimes goes wrong, but it’s hard to tell. Does the error shows a linenumber? Then the line of code can easily be found by going to the menu option ‘view source’.

No there is no mention of the line number , but is is clear it is that sql statement.

This is the error. The first two lines are text just to show me that i’n in the right part of the code.

Is there another way to do this?

2015-08-03_17-03-54.png

Perhaps it is the date thing, how do i convince myseft thah i’m passing a date to the querie?
The CAST should do that.but …

Regards
Erwin

i found it, the leading \ was not nescesary although via phpmyadmin it shows this like php code

With double quotes is not needed to escape ’ char maybe for this reason didn’t worked as expected.