Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Raleigh, NC

    Unanswered: Crystal Date Error

    I have Date field in my report which in database store as Number Data Type

    Ex: 20,000,327 which means 2000/03/27

    So in order to concer number to true date i have use following formula which has work fine in the past

    Numbervar Year1:=Truncate({DatesTimes.OrdDate}/10000);
    Numbervar Month1:=Truncate(({DatesTimes.OrdDate} - (Year1*10000))/100);
    Numbervar Day1:= Truncate ({DatesTimes.OrdDate}-Truncate ({DatesTimes.OrdDate}/100)*100);
    Date (Year1, Month1, Day1);

    but now for some reason when i try to run report i get error msg:

    "Dates must be between year 1 and year 9999"

    I can't figure out what's wrong and again this formula did work before.

    Any suggestion ?

    Thanks In Advance

  2. #2
    Join Date
    Oct 2005
    You have a resulting value or values outside the year range. Can you convert the numbers to string first and use left(), Mid(), or right() functions to extract year, month, and day?
    If you want to stick to your formula, check the records in database that contain incoherent data. you may want add a routine to validate every data before executing the formula.
    Last edited by fredservillon; 12-06-05 at 01:29.

Posting Permissions

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