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

Current date formula. 1

Status
Not open for further replies.

mudflap

MIS
Feb 14, 2002
194
CA
I have a field I am trying to do this with.

if (prepress wip(b.duedate) = current date then



What I want it to do is print out the one that equal the current date..What goes after then .
The formula works but just need the last part to tell me
what jobs are due or atleast the total that are due today.

Thanks

Peter
 
If you are saying you want a report with only current dated items in the report, then click on report, edit selection formula, record, and place the formula in there as follows:

{DateField} in CurrentDate

If this is not what you want then please explain further. Software Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
"If this is not what you want then please explain further."

I have a form that has about 32 jobs that are in our plant currently. I want it to print at the bottom of our already made report . How many or which jobs are currently due to go on todays date.

Thanks
Peter
 
"If this is not what you want then please explain further."

I have a form that has about 32 jobs that are in our plant currently. I want it to print at the bottom of our already made report . How many or which jobs are currently due to go on todays date.

Thanks
Peter
 
If you want that to show up at the bottom of your report, you'd have to have a variable catching all the jobs at the detail level, otherwise you'll only get the last relevant job show up in the report footer.

In the details section:

//@Formula1
whileprintingrecords;
numbervar counter := counter+1;
stringvar job;

If (b.duedate) = currentdate then
job := job + totext(counter,0)+". " {job.field} + chr(13)
else job

More informative than a total of jobs at the end, but the danger is you have to ensure that the length of the variable job never exceeds 254, or Crystal's going to not like it.

The alternative is to leave the formula in the details section at:

whileprintingrecords;
numbervar job := job + 1;

and call the variable in the report footer.


Naith
 
Made a mistake in the previous post, I see.

The {@Formula1} example would be placed at a job group level, not a detail level - unless your details stop you having duplicate jobs.

Naith
 
Thanks for the help..
But none of that makes sense to me..I am too new at this.
Step by step????

Thanks
Peter.

 
What is your "already made report" about? Is there any connection to this report and the stuff you want at the bottom of your report?

This sounds like you need a subreport of some type placed in the report footer, but I am not sure about the relationship between this data and the data on oyur already made report. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
What is your "already made report" about? Is there any connection to this report and the stuff you want at the bottom of your report?

This sounds like you need a subreport of some type placed in the report footer, but I am not sure about the relationship between this data and the data on your already made report. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
We have a report that we currently use to tell us the Jobs that are currently in the printing plant.
Fields like. Name of Company, due date, where are the jobs in the plant, time worked on.

Things like that. We have deadlines that are given to us.
once we make laser print we send it back to the customer to be checked.. This is the date I am trying to make a small count on.. All I want to do is either count how many jobs are due to go out today or highlight somehow the jobs that are due.

Thanks Hope this help clear things up.


Peter
 
Create a formula.

Insert either this:

whileprintingrecords;
numbervar counter := counter+1;
stringvar job;
If (b.duedate) = currentdate then
job := job + totext(counter,0)+". " {job.field} + chr(13)
else job

OR this:

whileprintingrecords;
If (b.duedate) = currentdate then
numbervar job := job + 1;

The first formula provides a job list. The second, a job total.

Place your finished formula in the job group footer - assuming there is one.

Create another formula:

whileprintingrecords;
stringvar job;

NB: If you used the second formula, use numbervar not stringvar to declare the job variable.

Place that formula in the report footer.

If you don't have a job group, and only have a details section where jobs are repeated then sort your report by job, if possible, and use the formula:

whileprintingrecords;
numbervar job;
If (b.duedate) = currentdate and
previous({job.field}) <> {job.field} then
job := job + 1;


Naith
 
The {job.field} I keep referencing is whatever the name of your field is in your database which holds your job information. I didn't know what else to call it, because you haven't given us that detail...

Naith
 
when I added either of those it gets stuck on the {job field}. I added in the date field field is that correct?

Which field does that variable want??
 
I've assumed that the field you'll be replace {job.field} with is a string field.

But with a little tweaking, you can use any datatype.

How are you defining jobs which you want to see? For example; if I imagine your set up to be like:

DateJobDue JobID JobName
01-Jan-2002 X01 Put out trash

then I'm thinking that you want to see 'X01' or '...trash' in the list. I don't see how a list of dates will be useful to you, if you already know that all the dates returned should be equal to the current date.

Replace {job.field} with the field which identifies each job.

Naith
 
here is the forumla I am using..Gives me a 0.00 output.

whileprintingrecords;
numbervar job;
If {Prepress WIP.Proofs Due (Date) (User Defined)} = currentdate and
previous({Prepress WIP.Docket (User Defined)}) <> {Prepress WIP.Docket (User Defined)} then
job := job + 1;


Prepress wip is the number associated to the job..
Does this make sense?

THanks
Peter
 
The docket field is a text field.. Does this cause problems.


THanks
Peter.

By the way thanks for all your help so far.
 
If your formula looks like

whileprintingrecords;
numbervar job;
If {Prepress WIP.Proofs Due} = currentdate and
previous({Prepress WIP.Docket}) <> {Prepress WIP.Docket}
then job := job + 1
else job;

then yes, that makes perfect sense. If you don't have jobs being duplicated, you only need your formula to read

Make sure you place this formula in your details section.

Naith
 
Placed that in the details section...
Two things..still gives me a 0.00 when there are 3 jobs due out today. And it gives me a 0.00 on every line.

 
({Prepress WIP.Docket (User Defined)}) <> {Prepress WIP.Docket (User Defined)}

what does that do?

Sorry I am very inexperienced as you can see in crystal reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top