Yes, single valued and Pick.
This works for me.
Thanks all.

Schalk


On Thu, 11 Mar 2004 08:30:02 -0500, Stevenson, Charles <[EMAIL PROTECTED]> wrote:


> Can somebody help me with the syntax of EVAL.  I want to execute a
> SELECT on a file to get all records where (field 16)*0.9 <
field(17).

Various ways to do this.  Try...
   SELECT file WITH EVAL "F16 * 0.9 < F17" = 1
where F16 and F17 are field names from the dictionary.

The most common mistake is to miss off the = 1 at the end.
Remember, this EVAL expression is going to return true or false.


1. Yes, but put quotes around the final literal 1:

WITH EVAL "F16 * 0.9 < F17" = "1"

or it will try to find a record called "1" in both the dictionary and
VOC.  Many Pick-style dicts have that.  Even if it doesn't exist today,
it might in the future.


2. You might be tempted to do:


     WITH EVAL "F16 * 0.9" < F17
 (or WHEN  ''    ''    ''     ''   for multivalued data)

which will probably work, but with EVALs you sometimes need to include
explicit formatting & conversion on the command line.   RetrieVe
sometimes outsmarts itself when sorting BY an EVAL or using an EVAL as a
display column.  By default it sometimes assigns to the EVAL the
conversion & justification of an element inside the EVAL.   Annoying,
that.   All this makes Martin's answer better, since it is more
explicit.


3. If you use Pick-style dictionaries, you can still use EVALs, and you can extract the fields you want:

WITH EVAL "@RECORD<16> * 0.9 < @RECORD<17>" = "1"


4. All this assumes single-valued fields, right? Let us know, because if either F16 or F17 are multi-valued, you'll need a variation on the theme by using "LTS" function and/or the WHEN keyword.


Chas. Stevenson



-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------
GWK BEPERK/LIMITED (REG: 1997/022252/06)
POSBUS 47 PO BOX 8730
DOUGLAS

Direkteure/Directors: NB Jacobs, FJ Lawrence, J v/d S Botes,
JH Coetzee, JGD Smit, JF Jacobs, AO Müller, JW Smit,
JP Snyman, JG Stander, JH van Dyk(MD/BD), JG Jacobs, A Müller,
Sekr/Secr: E van Niekerk.

Hierdie e-pos is onderworpe aan 'n vrywaring beskikbaar by:
http://www.gwk.co.za/DisclaimerVrywaring.asp
This e-mail is subjected to the disclaimer that can be viewed at:
http://www.gwk.co.za/DisclaimerVrywaring.asp

-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to