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!

Extract Fields

Status
Not open for further replies.

codrutza

Technical User
Mar 31, 2002
357
IE
CR 2013

Please help me whit this issue.

I have to compare values from table1.fielda, table1.fieldb, table1.fieldc with table2.field3, where:

In table1:
table1.fielda = 63.74
table1.fieldb = 67.99
table1.fieldc = 63.74

In table2:
table2.field3 = 63.74 Cbm 67.99 Cbm 63.74 Cbm

Maybe it’s a silly question, but is it possible somehow to extract the values separately from table2.field3?
 
If it is the 3 separate values within {Table2.Field3}, you could do it like this:

[Code Value_1]
Val(Split({Table2.Field3}, "Cbm")[1])
[/Code]

[Code Value_2]
Val(Split({Table2.Field3}, "Cbm")[2])
[/Code]

[Code Value_3]
Val(Split({Table2.Field3}, "Cbm")[3])
[/Code]

Hope this helps

Cheers
Pete

 
Thank you for your reply.
It doesn’t work, maybe I didn’t get it right.
{Table2.Field3} it’s a memo field and appears in Crystal Reports on 3 lines, sorry I didn’t say that before. I don’t know if it has to do with the result.
So the value of {Table2.Field3} appears like
63.74 Cbm
67.99 Cbm
63.74 Cbm
And when I use the formula
Val(Split({Table2.Field3}, "Cbm")[1]) I get 63.74
And when I use the formulas Val(Split({Table2.Field3}, "Cbm")[2]) Val(Split({Table2.Field3}, "Cbm")[3]) I get 0.

 
modify PMax code to
Code:
Val(Split({Table2.Field3}, "Cbm" & chr(13))[1]) 
Val(Split({Table2.Field3}, "Cbm" & chr(13))[2])
Val(Split({Table2.Field3}, "Cbm" & chr(13))[3])

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
hmmmmmmmm

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top