Solved

Evaluating a empty date field with Crystal Syntax

Posted on 2002-07-11
9
687 Views
Last Modified: 2007-12-19
I am trying to populate a field with one of three values based on this if statement.  Everything seems to evaluate properly except the "{@datecompleted}=Date (0,0,0)".  I thought this was the correct way to check for an empty date field but I guess I am wrong.  Can anyone help me out?

if ({@datecompleted} > {@daterequired}  )
then
"CLate"
Else if{@daysout}>60 and {@datecompleted}=Date (0,0,0)
then
"NLate"
Else
"On Time"
0
Comment
Question by:ccarlson62
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 7146405
ccarlson62

Try one of the following:

Else if {@daysout}>60 and {@datecompleted} <= date(0,0,0)

or this one

Else if {@daysout}>60 and {@datecompleted} <= date(0,0,0,0,0,0)

Depending on your database, you may need to check to see if the date is LESS THAN a null date value instead of EQUAL TO.  You may also need to explicitly null the time components of a date-time variable by including the extra 3 zeros.

DRRYAN3
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 7146950
You might also have to check as

Else if {@daysout}>60 and IsNull({@datecompleted})

mlmcc
0
 

Author Comment

by:ccarlson62
ID: 7149954
Thanks for the suggestions

I Have tried:

Else if {@daysout}>60 and {@datecompleted} <= date(0,0,0)

and this one...

Else if {@daysout}>60 and {@datecompleted} <= date(0,0,0,0,0,0)

and this one....

Else if {@daysout}>60 and IsNull({@datecompleted})

No luck so far, I am upping the points to 100 since this  does not look like it is going to be as simple as I had hoped.

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 12

Expert Comment

by:DRRYAN3
ID: 7150746
What database is the source of your data and which CR driver are you using to get to it?  Also, what version of CR do you have?
0
 

Author Comment

by:ccarlson62
ID: 7150785
I am using Crystal 8.5

I am using the Notes SQL Driver ver. 3.01

I am going after Data in a Domino Database Domino server ver. 5.0.10
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 7150952
I don't have Domino to test against.  

Perhaps Domino is not storing empty dates as a null value.  I searched the Domino Developer web site without success on this.  What value is in @datecompleted for a record you know to have a null value?

Last question - how have you declared the @datecompleted variable in your Crystal formula?
0
 
LVL 4

Accepted Solution

by:
jsweby earned 100 total points
ID: 7172824
I have successfully used the IsNull test before, however it MUST be the FIRST test done on that field, so intead of

if {@daysout}>60 and IsNull({@datecompleted})

use

if IsNull({@datecompleted}) and {@daysout}>60

J.
0
 
LVL 5

Expert Comment

by:gawilson2000
ID: 7224208
I have had a lot of trouble with null dates before too.

So I just check for:
ToText({@datecompleted}) = ''
0
 
LVL 5

Expert Comment

by:gawilson2000
ID: 7738634
You should be very wary with this solution.  

Another programmer may come along at a later date and add more code at the beginning.

I think that you will find that my code works regardless of the position.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question