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!

Expiring date

Status
Not open for further replies.

flashes24

IS-IT--Management
Oct 26, 2004
31
US
I have a database with invoice dates {dts}. The customer has 20 months to get a warranty extended. How can I check and post how soon before this option expires.
 
The format is in number format, but I have made the date in "Date (11/29/2004)" format already, so I have two locations to pull the date from.
 
A little more technical information would be helpful

[ul][li]Crystal Version (different version have different options)[/li]
[li]Database and connectivity[/li]
[li]Sample input data and links to show relationship[/li]
[li]Expected output (what do you want in each report section)[/li][/ul]

Assuming that your "date formula", {@dts}, used either the Date or CDate function, then the following record selection criteria will select all records from

dateadd("m",20,{@dts}) in dateserial(year(currentdate),month(currentdate)+ 1,1) to dateserial(year(currentdate),month(currentdate) + 20,1-1)

This should cover the period between 12/1/2004 through 6/30/2006

 
That might work for the forward end, but I'm looking for the past. In other words the list of people who's warranty is about to expire. I thank you for your help but I figured out what I needed to do on my own.

All I did was put the todays date back into numberical order by (year,month,date) using the left and mid function multiplying each by the appropriate value
2004 * 10000.00
12 * 100.00
31
and added them together. and it worked
HERE IS THE CODING:

(ToNumber (Mid (ToText(currentdate), 7, 4)) * 10000) + (ToNumber (Left (totext(CurrentDate), 2)) * 100) + (ToNumber (Mid (totext(currentdate), 4, 2)))

this formula takes out the "/" and puts it in value of 20041231.00 (yyyy,mm,dd)

Once again I thank you for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top