Test Data Manager

  • 1.  Data Type Conversion

    Posted Jul 31, 2018 09:04 AM

    When i performed this @subtract(@jdate(19-05-2018)@,5) in Data maker i am getting result, if i performed the same in CA TDM tool i am facing error like string type conversion.

    Any Help on this please.

     

     

    I guess the output of @jdate(19-05-2018)@ produces the result in String Format thus why making the error.

    How to convert data type from String to Number.?

     

    Very Much Thanks in Advance!!!!.

     

    Sample :

    When i executed this @subtract(@jdate(10-30-2250)@,1)@ in CA TDM Tool.

    Error Message : subtract: left: value cannot be converted to a number: "2543157,500000" 



  • 2.  Re: Data Type Conversion
    Best Answer

    Posted Aug 02, 2018 04:25 PM

    What TDM Tool is generating the error? Can you provide a screen shot?

     

    The JDATE function should be returning numeric values already. If it were returning a string, the SUBTRACT function would likely return an error.

     

    However, the JDATE function needs a DATE value passed into it, you're passing a STRING value...

     

    Try this:

    @subtract(@jdate(@date(10-30-2250,MM-DD-YYYY)@)@,1)@

     

    This returned: 2543157

     

    Functions are documented here:

    Data Generation Functions and Parameters - CA Test Data Manager - 4.5 - CA Technologies Documentation 

     

    However, sometimes they don't explicitly note the type of the output (as is the case with JDATE), however JDATE is founder the numeric section in Data Painter: