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

Warranty expiration info formula for --

Status
Not open for further replies.

jack91

Technical User
Apr 13, 2009
185
US
Hi,

I have created a formula for FUTURE warranty expiration info (see below)
I need help for creating a similar formula for computers which* already had warranty expired

For the computers that have warranty expired which of the computers have warranty expired within the next 30 days, 60 days and so on.
For this I am using:
if {column.warranty_end}>= currentdate and {v_asset1.warranty_end} <= currentdate+30 then
"Less than 30 days"
else ifcolumn.warranty_end} > currentdate+30 and {column.warranty_end}<= currentdate +60 then
"Between 30 - 60 days"
else if{column.warranty_end} > currentdate+60 and {column.warranty_end}<= currentdate +90 then
"Between 60 - 90 days"
else if{column.warranty_end} > currentdate+90 and{column.warranty_end}<= currentdate +365 then
"Between 90 days and 1 year"
else if{column.warranty_end} > currentdate+365 and {column.warranty_end}<= currentdate +730 then
"Between 1 - 2 years"
else if{column.warranty_end} > currentdate+730 then
"greater than 2 years"
else if isnull({column.warranty_end}) then
"no warranty"
else
"Warranty Expired"
------------------------------------------------------------


For OLD warranty expired info I created the following -- please correct it if its wrong.

if {column.warranty_end}= currentdate and {column.warranty_end} <= currentdate-30 then
"Expired within the last 30 days"
else if{column.warranty_end} >= currentdate-30 and {column.warranty_end}}<= currentdate -60 then
"Expired Between 30 - 60 days"
else if{column.warranty_end} >= currentdate-60 and {column.warranty_end}<= currentdate -90 then
"Expired Between 60 - 90 days"
else if{column.warranty_end} >= currentdate-90 and{column.warranty_end}<= currentdate -365 then
"Expired Between 90 days and 1 year"
else if{column.warranty_end} >= currentdate-365 and {column.warranty_end}<= currentdate -730 then
"Expired Between 1 - 2 years"
else if{column.warranty_end} >= currentdate-730 then
"Expired greater than 2 years ago"

Please advise
TIA
Jk
 
very close but modify the first line of both formulas as this should fix your problem.

not expired:
if {v_asset1.warranty_end} <= currentdate+30 then
"Less than 30 days"

because <= is the conditional operator.

and for the warranty expired:

if {column.warranty_end}= currentdate OR {column.warranty_end} <= currentdate-30 then
"Expired within the last 30 days"

because warranty_end can not meet both conditions
 
For the warranty expired:

****why do we need to use? -->

if {column.warranty_end}= currentdate

can we not use just:
{column.warranty_end} <= currentdate-30 then
"Expired within the last 30 days"

The OR is part of the formula right?

Thanks
Jk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top