Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula question 2

Status
Not open for further replies.

hereigns

MIS
Sep 17, 2002
172
US
CR 8.5

Based on the formula below, is there a way I can get the formula to ignore (not print) records that match "September 2004"? For a reason I have not been able to figure out the report is printing a blank September 2004 page in the report and am hoping for a "workaround" on this issue.

----------------------------------
WhilePrintingRecords;

"For the Month of " +
["January", "February","March","April","May","June",
"July","August","September","October","November","December"] [Month (DTSToDate ({tblMaster.DateRequested}))]
+ ", " + ToText (Year (DTSToDate ({tblMaster.DateRequested})), 0 , "")

 
What does this formula have to do with a blank page?

If you wish to eliminate September rows from the report, go into the Report->Edit Selection Formula->Record and place something like:

DTSToDate({tblMaster.DateRequested}) not in cdate(2004,9,1) to cdate(2004,9,30)

-k
 
synapsevampire,

I was thinking the formula would need to be adjusted to ignore the september 2004 entries.

I'm a rookie so don't be too harsh, when I entered the syntax you posted and ran formula check it did not like the text beginning with "not"...error:

"The remaining text does not appear to be part of the formula
 
It's in SQL. For Crystal,

Not(
DTSToDate({tblMaster.DateRequested}) in cdate(2004,9,1) to cdate(2004,9,30)
)
 
That worked, but now the report is not displaying "empty" records in the aforementioned field.

I need the report to pass through formula but I also need the report to print out any tblMaster.DateRequested records that are "empty" or blank.

Help?
 
Dear Wichitakid,

I think that

(
Isnull({tblMaster.DateRequested})
or
Not
(
DTSToDate({tblMaster.DateRequested}) in cdate(2004,9,1) to cdate(2004,9,30)
)
)

will work.

Regards,

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Use Ro's formula and if you have tables joined, make sure that you're using a Left Outer.

I fear that this is a quick and dirty solution to a larger problem though.

You might post:

Database/connectivity used
Example data
Expected output (based on the example data)

You shouldn't have to hardcode specific months out each time you run a report.

-k
 
Dear SV,

I agree with you on that... I was curious too.

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
SV and RO,
Thank you very much for your help! I agree with both of you this is a "patch" to a "bigger" problem.

Do you feel this should be a separate post or just a continuation of this one?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top