I am trying to write a report that does a datediff or dateadd, such as:
Dateadd("d", 1, {@DateTimeTaken}) < CurrentDateTime.
The error message I get is 'Hour must be between 0 and 23'.
Now, the formula field I created that is causing the problem is:
@datetimetaken
datetime(CDate({@DateTaken(requested)}),{@timetakendisplay})
@timetakendisplay is:
Time(ToNumber(Left({@TimeTaken},2)),ToNumber(Mid({@TimeTaken},3,2)),ToNumber(Right({@TimeTaken},2)))
@timetaken is:
if {WO_HEADER.Estimated_Complete_Time}="" then "000001" else {WO_HEADER.Estimated_Complete_Time}
WO_HEADER.estimated_complete_time is a varchar(8) field
If I comment out my formula so I can get it to run, my values for @timetaken are:
081500
092000
105000
110600
111600
111800
080000
090000
091500
111900
When I put @timetakendisplay on the report, I do not get errors and the time is displaying properly.
So I am stumped as to why my formula is giving me this error. Everything looks legit. Any help would be appreciated and I thank you in advance.
Dateadd("d", 1, {@DateTimeTaken}) < CurrentDateTime.
The error message I get is 'Hour must be between 0 and 23'.
Now, the formula field I created that is causing the problem is:
@datetimetaken
datetime(CDate({@DateTaken(requested)}),{@timetakendisplay})
@timetakendisplay is:
Time(ToNumber(Left({@TimeTaken},2)),ToNumber(Mid({@TimeTaken},3,2)),ToNumber(Right({@TimeTaken},2)))
@timetaken is:
if {WO_HEADER.Estimated_Complete_Time}="" then "000001" else {WO_HEADER.Estimated_Complete_Time}
WO_HEADER.estimated_complete_time is a varchar(8) field
If I comment out my formula so I can get it to run, my values for @timetaken are:
081500
092000
105000
110600
111600
111800
080000
090000
091500
111900
When I put @timetakendisplay on the report, I do not get errors and the time is displaying properly.
So I am stumped as to why my formula is giving me this error. Everything looks legit. Any help would be appreciated and I thank you in advance.