Solved

DateTime suppress

Posted on 2003-11-05
8
1,285 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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