This would probably work fine if the the input was a string field however the input is numeric.
The field is orderdate for merchandise and I am trying to compare the date to the results of this Date calculation which is when the order was actually filled.
A date format wouldn't be 7 chars at the minimum nor maximum, since you need 8 to show a date. If it's stored as such, you're in deep kim chee as a date such as:
11/1/2003 could be interpreted different ways when stored as:
2,003,111
Is it the 1st of November or the 11th of January?
Sounds like you are either dealing with a bad date format, or you don't understand the data.
Right click the field and select browse data, paste it somewhere, and then copy and post it here.
Note that Beth's formula assumes an 8 digit precision, which makes sense.
From the Crystal Support web site Article ID c2001866:
Synopsis
How can a whole number, like 98268.00, be converted to a date, where 98 is the year and 268 is the number of days since January 1st?
Solution
Create a formula that formats the field as a 5 digit string, passes it to a string variable, and then parses out the first 2 digits (for the year) into a number variable.
See the formula below which uses the date function to create a January 1st date with the year number variable, and adds the number of days less 1 to that January 1st date:
In the example below, {field} is the number in the database that represents the date, i.e. 98268.
NumberVar Year1;
StringVar Date1;
Date1 :=ToText({field}, "00000"
Year1 :=ToNumber(Date1[1 to 2])+1900;
Date (Year1,01,01) + (ToNumber(Date1[3 to 5]) - 1);
In this particular example (field = 98268), the date returned will be September 25, 1998.
Just an FYI -- I went back to the Crystal Decisions web site to look something else up & found out it's down as they convert it for the new company, Business Objects, that bought out Crystal.
Yeah, I knew the merger was coming a awhile back.
I was on their Crystal Decisions site one day and the next -- less than 24 hours later -- it was being switched.
If we're lucky they will continue the Knowledge base...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.