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 conversion to NumericText {batch}

Status
Not open for further replies.

sxmnl

Technical User
Joined
Dec 17, 2002
Messages
28
Location
US
I need some help. I'm new to Cystal.

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 225626565. 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.
Now I need to pull those 10 msec values out of the report and convert them ToNumber /60000 to get them into a minute format. in a single query. I really don't know how to get those 10msec numbers and convert them into a NumericText,
run the math and put them back without effecting the rest of the table.

Any help would be great I'm working today SUNDAY I will check
thanks in advance





 
When you say "convert them into a NumericText,
run the math and put them back without effecting the rest of the table", are you asking us how to change the values in your table? Crystal does not do this.

If you want to DISPLAY the values in teh table converted to minutes, just write a simple formula:

{PDL_VARIABLE_VIEW.VARIABLEVALUE}/60000

Please clarify what you are trying to do. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
If you want to modify the data in your table you will need to use a data conversion technique like SQL or a Query in MS Access.

CR only reports on data - it doesn't modify it.

Editor and Publisher of Crystal Clear
 
Thanks for the response,
Ok 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

Under the Variable Name this is a string, also under the Value table.

The value table comes across in a single query. The Batch Cycle Elapsed Time represents a time in msec.

I need a query that will evaluate the orig query and at selected Variables / Value name like
If NumericText ({file.FIELD}) Then
ToNumber ({file.FIELD
and /60000
I hope this helps
I'm just to new to this
Thanks
 
If you're trying to determine if the Value field is numeric, for certain variable name fields, and if so, divide it by 60000, then you're alomost there:

if {PDL_VARIABLE_VIEW.VARIABLENAME} = "Batch Cycle Elapsed Time" and NumericText({PDL_VARIABLE_VIEW.VARIABLEVALUE}) Then
ToNumber ({PDL_VARIABLE_VIEW.VARIABLEVALUE})/60000

For multiples you might say:

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

Which allows for multiple values in the variablename column.

Hard to say though, since you used the generic {file.FIELD} in your example, and you are seemingly referring to fields in a view (PDL_VARIABLE_VIEW) as tables, this is confusing and I assume incorrect, so I've accordingly demonstrated created this example.

Hope this sheds some light on it, if not, state specifics about the data you have (as in the example above) and the results you expect to get for which conditions.

-k kai@informeddatadecisions.com
 
synapsevampire thanks I'm even closer Now.
I ran 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

Ok know the Variable names that I claimed

["Batch Cycle Elapsed Time", "Batch Cycle Elapsed Time2"]

all change correctly.and it puts the rest of my values to "0" Is there a Else statment that will not change the rest of the values if not claimed like

else NumericText

Really thanks for your help. I'm still at work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top