Thank walther,
it 's very kind of you !
( ISNULL( e.iid ) AND Date() => TTOD(R.dentree) AND ( Date() =< TTOD(R.dSortie) OR R.dSortie ={})) OR ;
(Date() >= e.dDebut AND (Date() =< e.dFin OR (e.dFin={} AND (!E.lTransfert OR R.dSortie = {} OR Date() =< TTOD(R.dSortie)))))
>Hi Bernhart,
>
>I tried to simplify your expression and optimize it a, by getting rid of the IIF() structures.
>
>
(e.iid IS NULL AND Dvd => TTOD(R.dentree) AND (Dvd =< TTOD(R.dSortie) OR R.dSortie ={})) OR ;
>(Dvd >= e.dDebut AND (Dvd =< e.dFin OR (e.dFin={} AND (!E.lTransfert OR R.dSort = {} OR dvd =< TTOD(R.dSortie)))))
>
>However the error you're experiencing does not seem to have to do with the macro substitution. There must be an error in the whole expression (not that I could find it from what I know).
>
>Walter,
>
>
>>I progress but I still have problems
>>
>>
>>
>> PRIVATE dvd
>> dvd = DATE()
>>
>>
>> ccondit1 = "IIF(ISNULL( e.iid ), ?dvd BETW TTOD( R.dentree ) AND IIF(
>>EMPT( R.dsortie ) , ?dvd , TTOD( R.dsortie )),"+ ;
>> "?dvd BETW e.ddebut AND IIF( EMPTY( e.dfin ) = .T.,"+;
>> "IIF( e.ltransfert = .T. ,IIF(EMPTY( R.dsortie),?dvd ,TTOD(
>>R.dsortie )),"+ "?dvd ),e.dfin))"
>>
>>
>> INSERT INTO Sit ( nNombre, cCause ) ;
>> SELECT COUNT( RECNO() ) , 'Résidants Présents dont :' FROM
>>(AMLINE!Resident AS 'R';
>> LEFT OUTER JOIN AMLINE!Etats AS 'E' ON R.iid = e.iresidentid ) WHERE &ccondit1
>>
>>
>>
>>Missing expression (Error 152)
>>when I replace dvd by date() all functions well.
>>
>>What can i do ?
>>
>>Bedank
>>
>>bernhart
>>
>>
>>
>>
>>>Hi bernhart,
>>>
>>>>Bonjour Walter,
>>>>
>>>>What do we do if a macro is larger than 254 caractères ?
>>>
>>>You can use macro substitution with strings larger than 254 character. Probably them problem is that you cannot have literal string larger than that. so a work arround might be:
>>>
>>>
cCommand = "SELECT ... FROM ..... INNER JOIN " + "WHERE .... "+ " INTO CURSOR x"
>>>&ccommand
>>>
>>>Walter,