VishalMistry
22nd June 2011, 11:35
Hi all,

I have two sessions:

1.for specifying selection criteria. this session contains fields with enum type
2.this is a display session which is being called by first session and filters data based on criteria specified in first session

after specifying filter and calling the display session, it displays
error indicating illegal type combination error for the enum field. my code is given below:

import("rcno.f", filter.rcno.f)
import("rcno.t", filter.rcno.t)
import("stat.f", filter.stat.f)
import("stat.t", filter.stat.t)

query.extend.where(" whinh940.rcno >= " & quoted.string(filter.rcno.f), EXTEND_APPEND)
query.extend.where(" whinh940.rcno <= " & quoted.string(filter.rcno.t), EXTEND_APPEND)
query.extend.where(" whinh940.stat >= " & filter.stat.f, EXTEND_APPEND)
query.extend.where(" whinh940.stat <= " & filter.stat.t, EXTEND_APPEND)

can anybody guide me how can I use the values of enum fields filter.stat.f & filter.stat.t in query.extend.where ?

Pl guide.

Vishal

rahul.kolhe22
22nd June 2011, 11:52
Hi Vishal,

Try using:
query.extend.where(" whinh940.stat >= :filter.stat.f and whinh940.stat <= :filter.stat.t ", EXTEND_APPEND)

I think it should work.

One more thing which puzzled me was, with the below mentioned code how is it that you did not get the compilation error. Because there you are trying to append field filter.stat.f & filter.stat.t to a string and if am not wrong they are enum variables.

Hope it helps you.

Regards,
--Rahul

VishalMistry
22nd June 2011, 12:30
Hi Rahul,

Many many thanks. My issue resolved after following your syntax.

Thanks,
Vishal

JaapJD
22nd June 2011, 13:27
The alternative is: str$(etol(filter.stat.f)) in your original syntax.