benamorton
Technical User
- Mar 9, 2004
- 24
Hey All,
I am having problems converting a string into a date, so that even users running the runtime package of Crystal (I have 8.5) don't get errors.
The String sits as: "03/11/04 3/15/04" (w/o quotes)
First, I had this:
if length ({TRANS.COMMENTS}) >=8 then
datevalue(left({TRANS.COMMENTS},8))
but runtime users were getting:
Error in Formula //Datevalue A number, currency amt, Boolean is expected here.
So, I knew that datevalue was fairly new, so I tried simply:
if length ({TRANS.COMMENTS}) >=8 then
date(left({TRANS.COMMENTS},8))
but other users were getting errors again.
Then I tried:
date(tonumber({TRANS.COMMENTS} [1 to 2]),
tonumber({TRANS.COMMENTS} [4 to 5]),
tonumber({TRANS.COMMENTS} [7 to 8]))
But it says: A month must be between 1 and 12
So I figured it wanted month,day,year, so I tried:
date(tonumber({TRANS.COMMENTS} [4 to 5]),
tonumber({TRANS.COMMENTS} [1 to 2]),
tonumber({TRANS.COMMENTS} [7 to 8]))
But still won't work! If anyone has other ways I could try to convert this string into a date, I would be appreciative to hear them. Thanks in Advance
Ben
I am having problems converting a string into a date, so that even users running the runtime package of Crystal (I have 8.5) don't get errors.
The String sits as: "03/11/04 3/15/04" (w/o quotes)
First, I had this:
if length ({TRANS.COMMENTS}) >=8 then
datevalue(left({TRANS.COMMENTS},8))
but runtime users were getting:
Error in Formula //Datevalue A number, currency amt, Boolean is expected here.
So, I knew that datevalue was fairly new, so I tried simply:
if length ({TRANS.COMMENTS}) >=8 then
date(left({TRANS.COMMENTS},8))
but other users were getting errors again.
Then I tried:
date(tonumber({TRANS.COMMENTS} [1 to 2]),
tonumber({TRANS.COMMENTS} [4 to 5]),
tonumber({TRANS.COMMENTS} [7 to 8]))
But it says: A month must be between 1 and 12
So I figured it wanted month,day,year, so I tried:
date(tonumber({TRANS.COMMENTS} [4 to 5]),
tonumber({TRANS.COMMENTS} [1 to 2]),
tonumber({TRANS.COMMENTS} [7 to 8]))
But still won't work! If anyone has other ways I could try to convert this string into a date, I would be appreciative to hear them. Thanks in Advance
Ben