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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String coversion to Numeric then Back to sSring

Status
Not open for further replies.

sxmnl

Technical User
Joined
Dec 17, 2002
Messages
28
Location
US
I'm New to crystal, I'm so close now, I need just a little more help.

my table looks like this
Variable Name Value
------------- -----
Catalyst 1 Amt 1
Antifoulant Charged 0
Antifoulant Start Time 12/31/1979
Batch Cycle Elapsed Time 6215750
Batch End Time 12/31/1979

I have a table called {PDL_VARIABLE_VIEW.VARIABLENAME} this table has 100 names in it. I have another table called
{PDL_VARIABLE_VIEW.VARIABLEVALUE}this is a string table.
inside the {PDL_VARIABLE_VIEW.VARIABLEVALUE}I have dates & Numbers In the same table their is
about 10 variables that come thru in a msec value 6215750. In my query

I select the {PDL_VARIABLE_VIEW.VARIABLENAME} and all variables associated with that table
and{PDL_VARIABLE_VIEW.VARIABLEVALUE}and all variables values with a TASKID for that Batch

I used this code

if {PDL_VARIABLE_VIEW.VARIABLENAME} in ["Batch Cycle Elapsed Time", "Batch Cycle Elapsed Time2"]
and NumericText({PDL_VARIABLE_VIEW.VARIABLEVALUE}) Then
ToNumber ({PDL_VARIABLE_VIEW.VARIABLEVALUE})/60000


Then My table looks like this

Variable Name Value
------------- -----
Catalyst 1 Amt 0
Antifoulant Charged 0
Antifoulant Start Time 0
Batch Cycle Elapsed Time 103.59 => Good
Batch End Time 0

I see that it converted the msec correctly. Now need to convert the rest back to the orig string Value except the one I converted.

Is there a good ELSE statment I can use at the end of my original ?

Thanks In ADV...
 
Try:

if {PDL_VARIABLE_VIEW.VARIABLENAME}  in ["Batch Cycle Elapsed Time", "Batch Cycle Elapsed Time2"]
   and NumericText({PDL_VARIABLE_VIEW.VARIABLEVALUE}) Then
    totext(({PDL_VARIABLE_VIEW.VARIABLEVALUE})/60000)
else
{PDL_VARIABLE_VIEW.VARIABLEVALUE}

-k kai@informeddatadecisions.com
 
I think SynapseVampire actually meant:

if {PDL_VARIABLE_VIEW.VARIABLENAME} in ["Batch Cycle Elapsed Time", "Batch Cycle Elapsed Time2"]
and NumericText({PDL_VARIABLE_VIEW.VARIABLEVALUE}) Then
totext(ToNumber({PDL_VARIABLE_VIEW.VARIABLEVALUE})/60000)
else
{PDL_VARIABLE_VIEW.VARIABLEVALUE}
 
Thanks , That was it....Your DA MAN.

On to the next Battle

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top