Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"<Error>" result of simple Macro-Derived field- what's wrong?

Status
Not open for further replies.

ShaneSQ

Technical User
Nov 23, 2006
17
CA
Hello all!
(RS V4.2, ADP SQLBase)

I have a simple Macro-Derived Field to format termination dates into the "Medium Date" format. The code is as follows:
Code:
Sub TermDate2()
Dim TermDt
TermDt = Field("TERMINATIONDATEROE")

Dim TermDt2 as string
TermDt2 = Format$(TermDt, "Medium Date")

DerivedField Field$("TERMINATIONDATEROE")

End Sub

I'm using syntactically identical code to reformat the HireDateActual, with success.

The TERMINATIONDATEROE Field is Null for many employees.

The output is "<Error>" for ALL employees, even those who actually have a value in that field.

I tried putting:

Code:
If TermDt = "" Then
    DerivedField "-"
    Exit Sub
End If

into the macro, but with the same result (<Error>).

Any Ideas?

Many Thanks!
 
... I've also just tried:
Code:
If (IsNull(Field("TERMINATIONDATEROE")) = (-1)) Then
     DerivedField "-"
     Exit Sub
End If

at the very beginning of the macro, with the same result.
 
Ok, so the Field "TERMINATIONDATEROE" can't just be included "For Query Only"....

Problem Solved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top