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

Select Formula Problem - HELP!?!?!?

Status
Not open for further replies.

Darrick

Technical User
Aug 28, 2001
77
US
I've got a report with a sub report. In the Parent report I'm selecting all of the records based off a paramater (the parameter is a date range) DTE field. The Sub report is linked by the parameter field to the Download Date field. When a user selects the date range, let's just say for 8/1/01 - 8/31/01 (let us assume that it contains 4 Sundays within this range). If their is a Sunday within this range (DTE field), I need the subreport to recognize this and then use Saturdays data. The reason being is that the DTE field in the parent report only contains data from Sunday - Friday, and the Download Date field in the sub report only contains data from Monday - Saturday.

Something like this:

StringVar WhatDay;
DateVar PreviousDay := CDate(DateAdd("d",-1,{MOSAIX_CALL_LIST.DOWNLOAD_DATE}));

WhatDay := ToText(WeekdayName(DayOfWeek({?Pm-MOSAIX_CALL_LIST.DTE})));

If WhatDay = "Sunday" Then
PreviousDay = {?Pm-MOSAIX_CALL_LIST.DTE}
"Somehow this needs to be set equal to Saturday"
Else
{MOSAIX_CALL_LIST.DOWNLOAD_DATE} = {?Pm-MOSAIX_CALL_LIST.DTE}

I hope someone can understand what I'm trying to do. I'm sure someone has solved this problem before, so PLEASE HELP...

Thanks in advance,

Darrick
darrick3@yahoo.com
 
I can't follow the question, but these 3 things might help.

DayOfWeek( {datefield} ) returns a number from 1-7 for any datefield. 1 means Sunday.

{DateField} - 1 will give you one day before any date.

{DateField} - DayOfWeek( {datefield} )
always returns the Saturday prior to {DateField} Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Darrick,
You've posted something very similar in thread767-136403 a few days ago in this forum.
It is probably quicker to use a single thread to solve a single problem in a single forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top