>Can someone explain to me why this works:
>
>STOR ALLT(THISFORM.INVNUMB1.VALUE) TO INV
>SELECT *;
> FROM transactions!factgrostete INNER JOIN transactions!factgros ;
> ON Factgrostete.invnumb = Factgros.invnumb;
> WHERE Factgrostete.invnumb = "&INV";
> INTO CURSOR QUERY1
>
>And this does not:
>
>STOR ALLT(THISFORM.INVNUMB1.VALUE) TO INV
>SELECT *;
> FROM transactions!factgrostete INNER JOIN transactions!factgros ;
> ON Factgrostete.invnumb = Factgros.invnumb;
> WHERE Factgrostete.invnumb = INV;
> INTO CURSOR QUERY1
>
>Whit this one I get an Operand mismatch. The INV value is character and the invnumb field is character.
Along with the macro use idea, a Different Approach is to build your select statement via variable and then
SELECT (the contents of the resulting variable)
cQUERYWHERE= thisform.SC1.searchexpr()
cQUERYSTATUS= Upper(SUBSTR(thisform.lstTRANS.Value,1,7))
gQUERYORDER= thisform.lstFields.Value
sqlSELECT =" * From "+ Alias()+ " Where " + cQUERYWHERE + " Into Cursor Q3"+ ;
" ORDER BY "+ Alias()+"."+ cQUERYORDER
SELECT &sqlSELECT
Edgar L. Bolton, B.S. B.B.A.