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

clearing shared datevar

Status
Not open for further replies.

Boman

MIS
Joined
Jun 19, 2002
Messages
4
Location
US
My main report is grouped by Job Number. I need to use a sub report to evaluate the final ship date.

In sub report I have
shared datevar shipdate:= {dateentered}

In main report I have
shared datevar shipdate;
shipdate

I am getting the info. correctly to the main report, but I need to clear the datevar in the main report because it is holding the value of the previous job when the current job has no ship date.

I have tried inserting the following in the group footer of the main report, but it does not work.

shared datevar shipdate:= ""
This errors out saying "a date is required here".
Any help is greatly appreciated
 
Change it to:

whileprintingrecords;
shared datevar shipdate := date(0,0,0);

-LB
 
In a section PRIOR to running the subreport use something like:

shared datevar shipdate:= cdate(1970,1,1)

Then later when you are using the ship date do a check to determine that you received a date from the subreport, as in:

whileprintingrecords;
shared datevar shipdate;
if shipdate <> cdate(1970,1,1) then
<your usual action when there's a ship date>
else
<whatever action you want when there isn't a ship date.

I would also suggest trying to eliminate the subreport, this might be accomplished using a SQL Expression or a database object, but this is based on your software version, the database/connectivity used, which you didn't bother to post (this should be included with any post about any software in any forum).

-k
 
Many thanks to both of you. For those of us who struggle with this stuff, its nice that you share you knowledge.
Your help is greatly appreciated.

shared datevar shipdate := date(0,0,0);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top