even dates

  • Thread starter Thread starter Jean-Paul De WInter
  • Start date Start date
J

Jean-Paul De WInter

Hi,
I have 2 diffrent dates... Now I must know if the amount of days between
these dates is even or not...
Does anybody knows how??
Thanks
JP
 
think "even" is a bad translation..
2 should be even, or pair
1 or 3 is uneven or unpair....

Hope you all understand what i want!!
JP
 
Not sure where you will use this, VBA or a control, but for a text control try

=iif((abs(DateDiff("d", date1, date2))/2)= (abs(DateDiff("d", date1,
date2))\2),"Even","Odd")

It should be on one line

Change "date1" and "date2" to the names of your controls or field names


Steve
 
Hi,
I have 2 diffrent dates... Now I must know if the amount of days between
these dates is even or not...
Does anybody knows how??
Thanks
JP

If Abs([Date1]-[Date2]) Mod 2 = 0
' it's even
Else
' it's odd
End If
 
Even is the right word.

I think this should do what you want:

(DateDiff("d", date1, date2) Mod 2) = 0
 
Thank you all... perfect help, problem solved
JP
fredg said:
Hi,
I have 2 diffrent dates... Now I must know if the amount of days between
these dates is even or not...
Does anybody knows how??
Thanks
JP

If Abs([Date1]-[Date2]) Mod 2 = 0
' it's even
Else
' it's odd
End If
 
Back
Top