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!

How to put this in Formula screen?

Status
Not open for further replies.

bloomlight

IS-IT--Management
Jun 12, 2006
149
US
How to put the following code to Crystal Report formula screen?

{StartDate <= '01/31/2010' and DischargeDate >= '01/01/2010'} or {StartDate <= '01/31/2010' and DischargeDate is null)

When using this code on SQL server to generate a report, it works well. But when I try it on crystal report, the report only shows client who discharged. It seems that only the first part the code gets executed. I need a report which will show me the active clients during the month of Jan 2010. How can do that? Thanks.
 
Are your date fields of date datatype or are they really strings? If they are dates, the syntax should be as follows, with the null check first before the field is referenced again. The parens are necessary, too:

{table.startdate} <= date(2010,1,31) and
(
isnull({table.dischargedate}) or
{table.dischargedate} >= date(2010,1,1)
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top