Skip to Content
author's profile photo
Former Member

Converting Current Timestamp to numeric

I use the following statement in the Select Expert:

{PLINCD.INCALD} >= 20110101.00 and

{@Call Date} in LastFullMonth

I don't want to pull every incident in our system so I use the first statement. This works for a while until it gets outdated and has to search for thousands of records

This is what I use for converting from a timestamp to a numeric in SQL.

dec(

trim(substring(char(date((Current Timestamp - 1 months))),1,4)) ||

trim(substring(char(date((Current Timestamp - 1 months))),6,2)) ||

trim(substring(char(date((Current Timestamp - 1 months))),9,2))

)

I need to convert the ISO date/timestamp to character data then strip the dashes from it and then convert the character to numeric for Crystal Reports. Help.

Thanks.

Eric Greene

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Posted on May 05, 2011 at 06:22 PM

    Hi,

    Try the following :

    stringvar dt;

    dt:=(totext(Year(currentdate),'0000')&totext(Month(currentdate),"00")&totext(day(currentdate),'00'));

    tonumber(dt);

    Thanks,

    Sastry

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      You may try this :

      @DateConv

      stringvar dt;

      dt:=(totext(Year(currentdate),'0000')&totext(Month(currentdate),"00")&totext(day(currentdate),'00'));

      if ( tonumber(dt) - {PLINCD.INCALD} <= 160 then True

      else False

      Select Expert

      {@DateConv} and

      ....

      Thanks,

      Sastry