SOLVED
Using Dates in Formulas
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
tlewis
7 - Meteor
‎06-01-2019
06:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I do not understand why the formula result below is "No" (i.e. false). Both dates in the criteria are "2014-07-14" so I would expect the formula result to be "Yes" (i.e. true.)
If [TermDate] >= DateTimeAdd([TermDate], 2014 - DateTimeYear([TermDate]), "years")
Then "Yes"
Else "No"
Endif
Solved! Go to Solution.
Labels:
- Labels:
- Date Time
- Preparation
1 REPLY 1
17 - Castor
‎06-01-2019
06:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @tlewis
Try this:
If ToDate([TermDate]) >= ToDate(DateTimeAdd([TermDate], 2014 - DateTimeYear([TermDate]), "years"))
Then "Yes"
Else "No"
Endif
When comparing dates with DateTime formulas, you have to be sure they are Dates and not in DateTime format.
Otherwise, you can get unexpected results.
Cheers,
