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!

< Date Format Executes for Null Values

Status
Not open for further replies.

Hillary

Programmer
Feb 15, 2002
377
US
I have Part ID field that I want to strikeout if the Effecive Date is > today or if the Discontinue Date is < today. This way all the obsolete and future parts have a strikout throught them.

My original formual is
{REQUIREMENT.EFFECTIVE_DATE} > today or {REQUIREMENT.DISCONTINUE_DATE} < today
but it strikesout all parts where the Discontinue Date is null.

The next formual I tried is
If {REQUIREMENT.DISCONTINUE_DATE} = Date(0,0,0) then defaultattribute or
{REQUIREMENT.EFFECTIVE_DATE} > today or
{REQUIREMENT.DISCONTINUE_DATE} < today
This yeilds the same results.

Any idea on how to have the system not strikeout the Part ID if the Date is null?

Thanks,
Hillary
 
Have it check for the null first.

if isnull({REQUIREMENT.DISCONTINUE_DATE}) then false else
if {REQUIREMENT.EFFECTIVE_DATE} > today or {REQUIREMENT.DISCONTINUE_DATE} < today then true

Mike

 
Thanks for your help. It didn't work as is but it got me on the right track : ) I had to use both the isnull and Date(0,0,0)

If isnull({REQUIREMENT.DISCONTINUE_DATE}) and {REQUIREMENT.EFFECTIVE_DATE} <= today then false else
If isnull({REQUIREMENT.DISCONTINUE_DATE}) and {REQUIREMENT.EFFECTIVE_DATE} > today then true else
If {REQUIREMENT.DISCONTINUE_DATE} = Date(0,0,0) and {REQUIREMENT.EFFECTIVE_DATE} <= today then false else
If {REQUIREMENT.DISCONTINUE_DATE} = Date(0,0,0) and {REQUIREMENT.EFFECTIVE_DATE} > today then true else
If {REQUIREMENT.DISCONTINUE_DATE} < today then true

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top