# Formula Help for Date Reference

**URL:** <https://connect.superhuman.com/t/formula-help-for-date-reference/8943>\
**Category:** Ask the Community\
**Created:** [July 3, 2019, 10:17pm UTC](https://connect.superhuman.com/t/formula-help-for-date-reference/8943 "2019-07-03T22:17:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![agoodman](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/agoodman/32/19164_2.png) [@agoodman](https://connect.superhuman.com/u/agoodman)\
**Post date:** [July 3, 2019, 10:17pm UTC](https://connect.superhuman.com/t/formula-help-for-date-reference/8943/1 "2019-07-03T22:17:06Z")

</div>

I followed the [tutorial](https://connect.superhuman.com/t/capture-history-of-changes-create-log-of-changes-to-important-value-of-record/3353) on how to add a change history/log history to an item. Now I’m seeing a strange error.

![Capture](https://global.discourse-cdn.com/coda1/original/2X/3/3bbf3dce7d88537f8ef90ef90987b9fb24c111da.jpeg)

What is being returned is two dates. There should only be one in each cell.

![Capture](https://global.discourse-cdn.com/coda1/original/2X/a/a4cdf4483f48bd4cad2cf63f9358a158f433a606.jpeg)

How would I get it to restrict to show just the single date?

---

<div class="post-metadata">

**Author:** ![Krunal\_Sheth](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/krunal_sheth/32/5936_2.png) [@Krunal\_Sheth](https://connect.superhuman.com/u/Krunal_Sheth)\
**Post date:** [July 3, 2019, 10:58pm UTC](https://connect.superhuman.com/t/formula-help-for-date-reference/8943/2 "2019-07-03T22:58:31Z")

</div>

you would use either .First() or .Last() to pick an appropriate entry -

(I am not entirely sure what your business logic is - but if you expect to have multiple entries in Borrowing History for a specific borrower - you would get multiple `Date Needed` and then you want to sort and use .First or .Last depending on whether you want latest or earliest entry

---

<div class="post-metadata">

**Author:** ![agoodman](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/agoodman/32/19164_2.png) [@agoodman](https://connect.superhuman.com/u/agoodman)\
**Post date:** [July 5, 2019, 3:50pm UTC](https://connect.superhuman.com/t/formula-help-for-date-reference/8943/3 "2019-07-05T15:50:45Z")

</div>

Thank you for responding. What I’m trying to do is have three tables connected (Book, Borrower, Borrowing History). Therefore, when you look at the book Layout display, you get a nice embedded table showing the list of previous borrowers (in descending order). For e.g.

**Borrower** ----- **Date Borrowed**  
DEF -------------2/11/2019  
ABC -------------1/1/2019

If I don’t add .first(), I get the bad dates shown above. But if I do, I get the date for the _last_ book borrowed that person took out – even if it isn’t for this particular title. I’ve tried to modify the formula to refer to this title, but that gets me nowhere either.

![Capture](https://global.discourse-cdn.com/coda1/original/2X/8/889999a64e4cee76725f6e6f56cd92db1ee8cc41.jpeg)

I appreciate any pointers.

By the way, you wouldn’t have a guess as why the Borrowing History table that is embedded in a Book row will display as a table most of the time, but not always? In one of my Books, the Borrowing History shows up as a list of tags. The code is identical in all cases…

---

<div class="post-metadata">

**Author:** ![Krunal\_Sheth](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/krunal_sheth/32/5936_2.png) [@Krunal\_Sheth](https://connect.superhuman.com/u/Krunal_Sheth)\
**Post date:** [July 6, 2019, 4:57pm UTC](https://connect.superhuman.com/t/formula-help-for-date-reference/8943/4 "2019-07-06T16:57:34Z")

</div>

Not entirely following the problem - but my guess is you are showing `Books` with details layout (the picture in your post) but you are comparing `Borrowed By` (which i assumed to be the person who borrowed) to `thisRow` (which is a book?)

here’s an example, if this doesnt work, please share your document with `support@coda.io` and ask for me (Krunal) and would be happy to take a look

https://coda.io/embed/x4yrj39HRJ/_suXU7?viewMode=embedplay
