# Today function

**URL:** <https://www.epiusers.help/t/today-function/40237>\
**Category:** Epicor ERP 10\
**Created:** [September 7, 2017, 2:12pm UTC](https://www.epiusers.help/t/today-function/40237 "2017-09-07T14:12:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [September 7, 2017, 2:12pm UTC](https://www.epiusers.help/t/today-function/40237/1 "2017-09-07T14:12:09Z")

</div>

Trying to get the difference between two dates, one being a table filed, the other being today’s date. But the function Today is not recognized. I’ve tried Now, CDate and a few others. Any idea how to do this in Epicor 10?

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [September 7, 2017, 2:13pm UTC](https://www.epiusers.help/t/today-function/40237/2 "2017-09-07T14:13:04Z")

</div>

E10 BAQ’s use SQL so to get “TODAY” in SQL you use GetDate() function

---

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [September 7, 2017, 2:19pm UTC](https://www.epiusers.help/t/today-function/40237/3 "2017-09-07T14:19:12Z")

</div>

Awesome! Thanks for the info!

---

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [September 7, 2017, 2:45pm UTC](https://www.epiusers.help/t/today-function/40237/4 "2017-09-07T14:45:06Z")

</div>

@josecgomez if you don’t mind, I used the above funtion to get the date diference of how old a invoice was. Now, I am wanting to use those numebrs to add the dollars of the ones in a specifiec date diference range.

An example:  
Inv Date Inv Due Date $$ DateDiff  
7/31/2017 494381 8/30/2017 57.90 8  
7/31/2017 494382 8/30/2017 86.85 8

Wanting to do something like IIF(datediff between \<0 but \<=30, Sum the $$, IIF(datediff between 31 but \<60, Sum the $$,

So far I got the first half of that working, I just can’t get the adding the rows together for just those that have been identified to fit in that range.

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [September 7, 2017, 3:00pm UTC](https://www.epiusers.help/t/today-function/40237/5 "2017-09-07T15:00:44Z")

</div>

You can pretty easily use subqueries for this. Add a new subquery that adds together all invoices where the Dates fall within a certain range, then put that subquery as a calculated field.  
Like this

 ![image](https://epiusers.help/uploads/default/original/2X/9/96df37bf053b0f560603cad6599c53445a178eba.png)

See attached BAQ  
[INvcBal.baq](https://epiusers.help/uploads/default/original/2X/8/838e4cda5d1d11d8947f3e5d11371eb5bf2eebd0.baq) (24.5 KB)

---

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [September 7, 2017, 3:55pm UTC](https://www.epiusers.help/t/today-function/40237/6 "2017-09-07T15:55:24Z")

</div>

So, I imported your BAQ and for fun added another Subquery for over 30 days. And it totals every line the exact same number. Like it is adding all the invoices together for that range and using that number all the way through.  
So, what am i doing wrong? Starting to feel stupid…  
[INvcBal.baq](https://epiusers.help/uploads/default/original/2X/8/838e4cda5d1d11d8947f3e5d11371eb5bf2eebd0.baq) (24.5 KB)

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [September 7, 2017, 5:40pm UTC](https://www.epiusers.help/t/today-function/40237/7 "2017-09-07T17:40:42Z")

</div>

The one I gave you had 120 and 60-90 working make sure your new one has the same criteria / properties etc. Just change the date range. NOtice there is a subquery criteria on each subquery

---

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [September 7, 2017, 6:04pm UTC](https://www.epiusers.help/t/today-function/40237/8 "2017-09-07T18:04:39Z")

</div>

I got it working! Thanks!

---

<div class="post-metadata">

**Author:** ![Ziqqie\_ringstorm](https://www.epiusers.help/user_avatar/www.epiusers.help/ziqqie_ringstorm/32/50968_2.png) [@Ziqqie\_ringstorm](https://www.epiusers.help/u/Ziqqie_ringstorm)\
**Post date:** [January 30, 2023, 4:43am UTC](https://www.epiusers.help/t/today-function/40237/9 "2023-01-30T04:43:06Z")

</div>

Hi Guys, I’m trying to use the BAQ supplier list for due date from APInvHead. I tried follow the BAQ that has been provided from here but it came out empty. can anyone help? Below is my BAQ

[MW\_Supplier\_Summsry.baq](https://www.epiusers.help/uploads/short-url/ryqk7VjidZez9upSJVYpt496ytI.baq) (74.8 KB)

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [January 30, 2023, 4:47am UTC](https://www.epiusers.help/t/today-function/40237/10 "2023-01-30T04:47:34Z")

</div>

Could you provide some more details?  
You might want to create a new thread.
