Date compare error

make

Member
Hi there,

i want to compare two dates in a query:

(lajo.dat >= Zeitraum_von)
(lajo.dat <= Zeitraum_bis)


if Buchungsart = 2 then do:
OPEN QUERY {&SELF-NAME} FOR EACH lajo, each xaufpos
WHERE (xaufpos.aarnr = int(lajo.belegnr))
and (lajo.dat >= Zeitraum_von)
and (lajo.dat <= Zeitraum_bis) no-lock,
first homa.lieferer where lieferer.k-nr = int(substring(xaufpos.artikel_nr,1,2))
NO-LOCK.
end.

But it doesnt work !
Did i make a mistake ?
When i start the browser , he hangs up !

Greets
make
 
Are zeitraum_von and zeitraum_bis fields on the xaufpos table?

If not, and they are variables, should they be tested in the first condition?

if Buchungsart = 2 then do:
OPEN QUERY {&SELF-NAME} FOR EACH lajo
WHERE (lajo.dat >= Zeitraum_von)
and (lajo.dat <= Zeitraum_bis),

each xaufpos
WHERE (xaufpos.aarnr = int(lajo.belegnr))
no-lock,
first homa.lieferer where lieferer.k-nr = int(substring(xaufpos.artikel_nr,1,2))
NO-LOCK.
end.
 
Top