Solved

DateTime suppress

Posted on 2003-11-05
8
1,275 Views
Last Modified: 2012-08-13
I have a report that I need to suppress a date of 12/12/2012. Below is the crystal statement in the suppress details of the report. When I have just the first two if thens, the report runs fine. However the 3rd if then to suppress the dates does not.  The information is pulled from a SQL database and I am using CR8 for my reports. The field in the SQL database is a DateTime field. Thanks in advanced.

BooleanVar  bNotPrint := True;
IF {SchJob.JobStatus} = 0 THEN
  bNotPrint := False
ELSE
  IF IsNull ({SchJob.JobNumber}) THEN
    bNotPrint := False
ELSE
  IF {OpenJob.DueDate} = DATE(2012,12,12) THEN
    bNotPrint := False
ELSE
bNotPrint;
0
Comment
Question by:perichards
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 9687979
Possible it's a datetime comparison to a date issue.  Try:

If CDate({OpenJob.DueDate}) = DATE(2012,12,12) Then...

This way if the DueDate is stored as 12/12/2002 11:59:59 your comparison will work...
0
 

Author Comment

by:perichards
ID: 9688244
Even though the SQL format of the table says datetime, the value is still stored as just a date. I am not sure if that will make a difference or not. When I added the CDate CR8 said it expected a date-time here. I amy have miss led you. Sorry. Either way I am still stuck. anything else to try?

per
0
 
LVL 77

Expert Comment

by:peter57r
ID: 9688410
At the risk of sounding stupid, Suppression formulas are usually written to give a value of True when you want to suppress and False when you want it to appear.
Are you taking this into account?

Pete



0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 9688676
Are you using this in the field suppression formula?

 IF {OpenJob.DueDate} = DATE(2012,12,12) THEN
   bNotPrint := False

Why is this set to FALSE if you want to suppress it?  It should be true.

If your formula is correct you will show records when
 
{SchJob.JobStatus} = 0
OR
IsNull ({SchJob.JobNumber})
OR
{OpenJob.DueDate} = DATE(2012,12,12)

Are you getting an error or just data you don't want.

mlmcc
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:perichards
ID: 9690136
To be honest I am following a formula that was set inside a pre-built report. I am new to crystal and am a little unsure of the terminology used for their reports. I am a vb & access guy. This is all French to me. The first two are records that I do want and the third is records that I don't want. I did change it to true but the the records with the due date of 12/12/2012 still showed up on the report. Is there an order that the if..then's need to be in to suppress records properly? If there is a better way to write this I sure could use the help. Thanks again.

per
0
 
LVL 42

Expert Comment

by:frodoman
ID: 9690190
You need to change the result of the last condition to TRUE then instead of setting it to FALSE...
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9692270
Is the date field in question really a date time field.  If so you will need to extract the date from the field and then compare.

Datepart({OpenJob.DueDate}) = DATE(2012,12,12)

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9718964
Glad I could help

mlmcc
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now