calculated field using record num in report problem with 4.5 dos

calculated field using record num in report problem with 4.5 dos

I need to create a calculated field in a report that maps record 1 to 120, 2
to 130, 4 to 140 and so on.  When I try use the record number [#], Paradox
will not accept it and gives me an error message.  The calc'd field should
have looked like this "10*[#]+110" to perform as wished.  It is just the
reference to the record number that is hosing me up.  Any ideas?

calculated field using record num in report problem with 4.5 dos

Here's an example of how. Adapt it to your own circumstances as
appropriate:

1. Create a new report
2. Add a TableFrame object to the AllRecords band
3. Right-click the TableFrame and select Define Table
4. Select a table and bind two fields
5. Select the left-most column (click in the third row until the
column selects) and insert a new column - it will now be the new
left-most column
6. Define the field; drop the field list and select "Record
Number".
7. Repeat step 5
8. Define this new field as a calculated field with the formula

( 10 * Record_Number ) + 110

Run report

QED.

You can, of course, arrange things so that the Record Number
field is not visible, and you can drag that field into another
column and dispense with the column entirely !

hth

Mike

Quote:> I need to create a calculated field in a report that maps record 1 to 120, 2
> to 130, 4 to 140 and so on.  When I try use the record number [#], Paradox
> will not accept it and gives me an error message.  The calc'd field should
> have looked like this "10*[#]+110" to perform as wished.  It is just the
> reference to the record number that is hosing me up.  Any ideas?

calculated field using record num in report problem with 4.5 dos

Mike,

Those don't like like PdoxDOS instructions to me.

--
Kevin
(if you email me, make sure to DeSpamulate my address)
------------------------------
-     Kevin Donaker-Ring     -
-  Executive Director, AISE  -
-    http://www.aise.com     -
------------------------------

> Here's an example of how. Adapt it to your own circumstances as
> appropriate:

> 1. Create a new report
> 2. Add a TableFrame object to the AllRecords band
> 3. Right-click the TableFrame and select Define Table
> 4. Select a table and bind two fields
> 5. Select the left-most column (click in the third row until the
> column selects) and insert a new column - it will now be the new
> left-most column
> 6. Define the field; drop the field list and select "Record
> Number".
> 7. Repeat step 5
> 8. Define this new field as a calculated field with the formula

> ( 10 * Record_Number ) + 110

> Run report

> QED.

> You can, of course, arrange things so that the Record Number
> field is not visible, and you can drag that field into another
> column and dispense with the column entirely !

> hth

> Mike

>>I need to create a calculated field in a report that maps record 1 to 120, 2
>>to 130, 4 to 140 and so on.  When I try use the record number [#], Paradox
>>will not accept it and gives me an error message.  The calc'd field should
>>have looked like this "10*[#]+110" to perform as wished.  It is just the
>>reference to the record number that is hosing me up.  Any ideas?

calculated field using record num in report problem with 4.5 dos

> Those don't like like PdoxDOS instructions to me.

I didn't notice that it said DOS either..

--

Steve Green - Diamond Software Group, Inc - Waldorf Maryland USA
---------------------------------------------------------------------------------
Do you need a Sanity Check? http://www.diamondsg.com/sanity.htm
-------------------------------------------------------------------------

calculated field using record num in report problem with 4.5 dos

> I need to create a calculated field in a report that maps record 1 to 120, 2
> to 130, 4 to 140 and so on.  When I try use the record number [#], Paradox
> will not accept it and gives me an error message.

in a PdoxDOS report, you can't do it that way.. if you *must* use Recno() in a
calc, you'll need to create an extra field, SCAN the table to seed it with
RECNO(), then use that field in your calcs..

--

Steve Green - Diamond Software Group, Inc - Waldorf Maryland USA
---------------------------------------------------------------------------------

Do you need a Sanity Check? http://www.diamondsg.com/sanity.htm
-------------------------------------------------------------------------

calculated field using record num in report problem with 4.5 dos

They're not ... I didn't read the last word in the title because
it truncated. Sorry. However, maybe Steve can tell you if the
same principle holds true ...

Mike

Quote:> Mike,

> Those don't like like PdoxDOS instructions to me.

calculated field using record num in report problem with 4.5 dos

Thanks, I shall give that a try.

> > I need to create a calculated field in a report that maps record 1 to
120, 2
> > to 130, 4 to 140 and so on.  When I try use the record number [#],
> > will not accept it and gives me an error message.

> in a PdoxDOS report, you can't do it that way.. if you *must* use Recno()
in a
> calc, you'll need to create an extra field, SCAN the table to seed it with
> RECNO(), then use that field in your calcs..

> --

> Steve Green - Diamond Software Group, Inc - Waldorf Maryland USA
> --------------------------------------------------------------------------
-------

> Do you need a Sanity Check? http://www.diamondsg.com/sanity.htm
> -------------------------------------------------------------------------

I can't make sense why a calculated field as simple as:

[Sacchi]*IIF([Descrizione]="coccio",50,30)

should smoothly work on my computer but doesn't on a 386 with 8mb. [Sacchi] is
a numeric field, while [Descrizione] is alphanumeric; they are both already
present on the form, which is multirecord. It does its job on my computer but
when I transfer it on this 386, where the Paradox version in exactly the same,
it crashes with a MakeExprTree error, giving the hint it might be due to a
damaged form. If I try to type in the calculated field directly on that
computer, it gives a syntax error on the above formula. Any idea ?