Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    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 a 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.