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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Selection on two date fields

Status
Not open for further replies.

MiagiSan

IS-IT--Management
Aug 1, 2005
51
CA
Hi there,

I am using CR10 with an SQL DB. I am currenly working on a report that will show me the number of support cases that were either opened or closed in a date range.

This record selection works fine:

{CASE.BUSINESS_UNIT}="SSPSG" and
{CASE.ATTRIBUTE_ID}="PS_PSGPH" and
{CASE.CLOSED_DTTM} in {?Date}

When I add the Open Field, it takes forever. (you can see Crystal counting thousands of records in the bottom right corner of the screen.)

({CASE.BUSINESS_UNIT}="SSPSG" and
{CASE.ATTRIBUTE_ID}="PS_PSGPH" and
{CASE.CLOSED_DTTM} in {?Date})
or
({CASE.BUSINESS_UNIT}="SSPSG" and
{CASE.ATTRIBUTE_ID}="PS_PSGPH" and
{CASE.OPEN_DTTM} in {?Date})

Is there a way that I can optimize this record selection? I have also tried this:

{CASE.BUSINESS_UNIT}="SSPSG" and
{CASE.ATTRIBUTE_ID}="PS_PSGPH" and
({CASE.OPEN_DTTM} in {?Date} or {CASE.CLOSED_DTTM} in {?Date})

This returned only the cases that were opened in the date range.

Thanks very much..I hope I have included enough infomation.

R

 
I think your last attempt should work with one tweak:

{CASE.BUSINESS_UNIT}="SSPSG" and
{CASE.ATTRIBUTE_ID}="PS_PSGPH" and
(
(
{CASE.OPEN_DTTM} in {?Date} and
(
isnull({CASE.CLOSED_DTTM}) or
{CASE.CLOSED_DTTM} >= CASE.OPEN_DTTM}
)
) OR
{CASE.CLOSED_DTTM} IN {?Date}
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top