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 Comparison

Status
Not open for further replies.
Jan 3, 2011
6
US
I am trying to Compare 2 dates. If the first date is null then return the value of the second date; otherwise use the value from the first date. However, this does not seem to be working since I get a False instead of the date. Can someone please help?

if isnull(({View_test.UDF_REVISED_NS_PROMISE_DATE}))
then {View_test.UDF_REVISED_NS_PROMISE_DATE} = {View_test.UDF_NS_PROMISE_DATE}
 
Hi,
Where are you using this - as constructed it could only be used as a selection criterion not a formula to return a result ( except as you noted, TRUE or FALSE )
If you want to show one or the other in your report then a formila like:
@ShowDate
Code:
If IsNull({View_test.UDF_REVISED_NS_PROMISE_DATE})
then
 {View_test.UDF_NS_PROMISE_DATE} 
else
{View_test.UDF_REVISED_NS_PROMISE_DATE}
should do it.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
is that it is know giving me the The Revise Date; but if there is no date for the the Revised date, the value for the Promised dat is not bein displayed.

If I have the following: 09/27/2010 for Promised Date and 10/27/2010 for Revise Date, I am seeing the Revised Date as expected. However, if the Promised Date is 11/15/2010 and the Revised date in null, then I am expecting to see the original Promised Date in that field.
 
Hi,
Maybe the NULL is actually blank ( can be database dependant) so try this revised formula:
Code:
If (
IsNull({View_test.UDF_REVISED_NS_PROMISE_DATE})
OR
{View_test.UDF_REVISED_NS_PROMISE_DATE} = Date(0,0,0)
)
then
 {View_test.UDF_NS_PROMISE_DATE} 
else
{View_test.UDF_REVISED_NS_PROMISE_DATE}



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
THANK YOU SO MUCH! That worked. I am just a beginer so I appreciate your help and your explanations which helped a lot!
 
Hi,
Glad you got it worked out...Happy to help.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top