Solved

DateTime suppress

Posted on 2003-11-05
8
1,281 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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. …
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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