[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

DateTime suppress

Posted on 2003-11-05
8
Medium Priority
?
1,305 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
[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
  • +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
Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

 
LVL 101

Accepted Solution

by:
mlmcc earned 1000 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 101

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 101

Expert Comment

by:mlmcc
ID: 9718964
Glad I could help

mlmcc
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

650 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