Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding numbers to select values within one field

Status
Not open for further replies.

d44

MIS
May 30, 2002
17
GB
One table in report is called property_descriptor.This table has numerous
fields,but the ones in question are 'descriptor' and descriptor_value.

'descriptor' describes information on certain properties and there is a
large selection. Below is a few examples of what this field can contain:

e.g. DATB: is Build Date of Building
BEDS: number of bedrooms
WNDS: no of windows....etc

The descriptor_value is the associated value with regards to the descriptor.

e.g. the DATB of certain property,the descriptor_value would be a date field
such as. 01/12/1921 and the BEDS field would be 2,3,4 etc.

The report has 2 descriptor_values displayed, one for the "DATB" and one for
the "BEDS".I am looking to add and value of "1" to the "BEDS" only and not
to the other values within the same field. i.e. DATB(date field),WINDS etc

Thanks
 
So something like:

//@Beds Increaser
If descriptor = 'BEDS' then tonumber(descriptor_value) + 1;

Naith
 
you should give more details in your problem explanation but this seems to be another question of a similar post you made so I know the {value} field is a string...not numeric

to update a sting field by one simply convert it to a number ...add to it and convert back to a string

ie

whilePrintingRecords;

if {descriptor} = "BEDS" then
totext(tonumber({value}) + 1,0)
else
{value};

But this is hard coding the result....Also I wonder why you are doing this....Crystal cannot update a database. You are only doing this for report purposes. Jim Broadbent
 
Re Noglem.

Just for reporting purposes that I have to add one to the BEDS value
 
ok then my formula should work . Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top