S staholly Registered User. Local time Today, 15:53 Joined Jul 14, 2011 Messages 16 Jul 14, 2011 #1 I need to write a statement that does the following: If closed date is empty than subtract date opened from today’s date if not subtract closed date from opened date.
I need to write a statement that does the following: If closed date is empty than subtract date opened from today’s date if not subtract closed date from opened date.
jdraw Super Moderator Staff member Local time Today, 15:53 Joined Jan 23, 2006 Messages 15,498 Jul 14, 2011 #2 What have you tried?
S staholly Registered User. Local time Today, 15:53 Joined Jul 14, 2011 Messages 16 Jul 14, 2011 #3 I tried iif(isnull([date closed]),datediff("d",date(),[date opened]),datediff("d",[date closed],[date opened]) This is for Acess 2003
I tried iif(isnull([date closed]),datediff("d",date(),[date opened]),datediff("d",[date closed],[date opened]) This is for Acess 2003
pbaldy Wino Moderator Staff member Local time Today, 12:53 Joined Aug 30, 2003 Messages 36,157 Jul 14, 2011 #4 That looks basically okay, though you missed the parentheses to close off the IIf() function. Try iif(isnull([date closed]),datediff("d",date(),[date opened]),datediff("d",[date closed],[date opened])) Does it error, or ?
That looks basically okay, though you missed the parentheses to close off the IIf() function. Try iif(isnull([date closed]),datediff("d",date(),[date opened]),datediff("d",[date closed],[date opened])) Does it error, or ?