Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2013
    Posts
    4

    Question Unanswered: The string is non-numeric

    Hi!
    I have a strange problem. I've made a Custom TimeStamp function -->

    Code:
    Function (Numbervar TimeStampfield)
    Numbervar yr; 
    Numbervar mon; 
    Numbervar dt; 
    numbervar hh; 
    numbervar mm; 
    numbervar ss;
    Stringvar datefield:= (totext(TimeStampfield)); 
    datefield:= Replace(datefield,",","");
    datefield:= Replace(datefield,".","");
    yr:=tonumber(mid(datefield,1,5));
    mon:=tonumber(mid(datefield,6,3));
    dt:=tonumber(mid(datefield,9,2)); 
    hh:=tonumber(mid(datefield,11,3));
    mm:=tonumber(mid(datefield,14,3));
    ss:=tonumber(mid(datefield,17,2));
    cdatetime(yr,mon,dt,hh,mm,ss);
    And when I'm trying to open my custom report with HDauthority, it will occur an error (Attachment ERROR.jpeg).

    Everything is working fine in Windows 7, 64bit but with Windows XP, 32bit that TimeStamp function causes an error??? And with VMware where is windows XP, 32bit it also works so where's the problem, I'm confused.
    Attached Thumbnails Attached Thumbnails ERROR.JPG  

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Your function is relying on the format of TimeStampfield being consistent.

    Imagine your value is 31/12/2013: if you grab the first two characters then you get 31, which will happily convert to a number.

    Now what happens if your value is 1/7/2013? If you grab the first two characters this time then you get 1/ which won't convert in to a number.
    George
    Home | Blog

  3. #3
    Join Date
    Jul 2013
    Posts
    4
    My data is always in this kind of format, never null, which why I made the TimeStamp formula: 20 121 101 101 651,00 (01/11/2012 10:16:51)

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Well your error message is certainly suggesting otherwise!

    Other options include your TimeStampField being too short, causing your mid() functions to return a blank string or null.

    Take a good hard look at your source data.

    Incidentally, where is your data coming from?
    George
    Home | Blog

  5. #5
    Join Date
    Jul 2013
    Posts
    4

    Thumbs up

    Hello!!

    Issue is solved!! I made the whole report again from beginning to end and now it's working. There was something wrong with database links.

    And date data was actually in format 20,100,313,110,849.00

    I modified also the TimeStampToDate function:
    Code:
    Function (Numbervar TimeStampfield)
    
    Numbervar yr; 
    Numbervar mon; 
    Numbervar dt; 
    numbervar hh; 
    numbervar mm; 
    numbervar ss;
    
    Stringvar datefield:= (totext(TimeStampfield)); 
    datefield:= Replace(datefield,",","");
    datefield:= Replace(datefield,".","");
    
    yr:=tonumber(mid(datefield,1,4));
    mon:=tonumber(mid(datefield,5,2));
    dt:=tonumber(mid(datefield,7,2)); 
    hh:=tonumber(mid(datefield,9,2));
    mm:=tonumber(mid(datefield,11,2));
    ss:=tonumber(mid(datefield,13,2));
    
    cdatetime(yr,mon,dt,hh,mm,ss);
    Thank you for all your replys

    P.S Would you mind to look at my other issue: http://www.dbforums.com/crystal-repo...ml#post6596555 (Zero and null values in cross-tab) THANKS!!
    Last edited by tuolil; 07-04-13 at 06:32. Reason: Modification

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •