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!

need to display lapsed days

Status
Not open for further replies.

andie18

MIS
Aug 14, 2001
198
US
Hello,

New Report, new dilemma, same database (GoldMine 5.5 MSSQL 2K - Crystal 8.5 Developer)

This time I need to display all records/accounts that have pending sales. One of the field I need to display is how many days left until the sale date ({cal.ondate}) So I need a formula that takes today's dat and then subtracts it from the sale date.

COMPANY SALEDATE TODAYSDATE LAPSED DAYS
ABC, Inc. 8/1/2004 7/21/2004 -12

I then also need to show the date if the sale still is pending after the sale date

COMPANY SALEDATE TODAYSDATE LAPSED DAYS
ABC, Inc. 8/1/2004 8/21/2004 20

Then I need to stick a conditional formula on the lapsed days if it passes the sales date to change color. So example "A" is black but example "B" is red

btw... I put the TODAYSDATE in as something for you to visualize what I am trying to do, I am actually hoping for Crystal to read from my system date at print time.

Thanks for all of the help!
 
Here's the formula for the date difference:

currentdate-{table.date}

Purdy simple.

As for highlighting it, you have many options there, since you didn't state what would be highlighted, I'll assume that it's the font of all of the text itself as opposed to the background color:

Lasoo the fields objects in the section that you want to conditionally change the colors of and select Format Objects->Font->X 2 next to the Color and use something like:

If currentdate-{table.date} > 0 then
CRRed
else
CRBlack

You can also use this in other areas such as the Background formula for the ebtire section if you'd prefer.

-k

-k
 
what can I say? except doh!

I'm having one of those days today. The DNS servers where these data servers are located keep failing and disconnecting Crystal. I have had to rewrite one of the reports and make new ODBC connections.

thanks for the help

wait! I remember what my hangup was. This client wants the dates displayed in reverse. Meaning that if there are 12 days left to show it as -12 instead of 12 and after the 0 day mark hits, instead of -20 it is 20 (or he said +20)
 
Try the following for display purposes if you need both the plus and minus signs:

If currentdate-{table.date} > 0 then
"+"+totext((currentdate-{table.date})*-1),0,"")
else currentdate-{table.date} < 0
"-"+totext((currentdate-{table.date})*-1),0,"")

There are other means as well.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top