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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do I get a Null value?

Status
Not open for further replies.

southbean

Technical User
Jun 3, 2005
147
US
Hello All,

I’m trying to solve a larger problem with this smaller problem. Here’s my formula:

Code:
Local DateTimeVar SolvedDate1 := DateTime({PROBLEMS.SOLVED_DATE},{PROBLEMS.SOLVED_TIME});
Local DateTimeVar ClosedDate1 := DateTime({PROBLEMS.CLOSE_DATE},{PROBLEMS.CLOSE_TIME});

WhilePrintingRecords;
If SolvedDate1 = DateTime(0,0,0,0,0,0) Then
ClosedDate1 
Else
SolvedDate1

The problem is this: When there is a record with a SolvedDate1 date populated and a ClosedDate1 that is Null the formula returns a null value. Why?!?!?

Any and all help with this would be greatly appreciated!!!

- t
 
Try this

Code:
Local DateTimeVar SolvedDate1 := DateTime({PROBLEMS.SOLVED_DATE},{PROBLEMS.SOLVED_TIME});
Local DateTimeVar ClosedDate1 := DateTime({PROBLEMS.CLOSE_DATE},{PROBLEMS.CLOSE_TIME});

WhilePrintingRecords;
If isnull(SolvedDate1) or SolvedDate1 = "" then
  ClosedDate1
ELSE
  SolvedDate1
-LW
 
Change that

Code:
Local DateTimeVar SolvedDate1 := DateTime({PROBLEMS.SOLVED_DATE},{PROBLEMS.SOLVED_TIME});
Local DateTimeVar ClosedDate1 := DateTime({PROBLEMS.CLOSE_DATE},{PROBLEMS.CLOSE_TIME});

WhilePrintingRecords;
If isnull(SolvedDate1) or SolvedDate1 = date(0,0,0,0,0,0) then
  ClosedDate1
ELSE
  SolvedDate1
 
Hello kskid,

Thank you for your reply. I did try something similar (I should have posted that). I get an error message of: "A field is required here" in the 'isnull(SolvedDate1)' section.

Removing that, I still get the same result.

Thanks again!

- t
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top