# Week-numbers store in tables

**URL:** <https://community.tulip.co/t/week-numbers-store-in-tables/4974>\
**Category:** Support, Troubleshooting, & Help\
**Tags:** apps\
**Created:** [April 12, 2022, 8:09am UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974 "2022-04-12T08:09:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![h.koren](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@h.koren](https://community.tulip.co/u/h.koren)\
**Post date:** [April 12, 2022, 8:09am UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/1 "2022-04-12T08:09:52Z")

</div>

I would like to store the week numbers in our production tables.  
Is this possible?

---

<div class="post-metadata">

**Author:** ![Pete\_Hartnett](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/pete_hartnett/32/3678_2.png) [@Pete\_Hartnett](https://community.tulip.co/u/Pete_Hartnett)\
**Post date:** [April 12, 2022, 11:01am UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/2 "2022-04-12T11:01:37Z")

</div>

Hey @h.koren

Using the DATETIMETOTEXT() function should be able to achieve this.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/d/d8cf771a2aa62089d5d42164fdfaee4e7dfbbe28.png)

Let me know if this doesn’t solve your problem  
Pete

---

<div class="post-metadata">

**Author:** ![h.koren](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@h.koren](https://community.tulip.co/u/h.koren)\
**Post date:** [April 12, 2022, 11:58am UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/3 "2022-04-12T11:58:33Z")

</div>

Hi Pete,  
Thanks that works!!!

I want to use this to reset a variable to the number 10.  
So when a new week starts, the variable becomes number 10 again.  
Next question; Is there also a trigger that looks at the last recorded DATE? I don’t use APIs

---

<div class="post-metadata">

**Author:** ![Pete\_Hartnett](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/pete_hartnett/32/3678_2.png) [@Pete\_Hartnett](https://community.tulip.co/u/Pete_Hartnett)\
**Post date:** [April 13, 2022, 11:53am UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/4 "2022-04-13T11:53:31Z")

</div>

Hey Henk,

Shouldn’t need the API for this. Just to better understand, you are looking to get the date of the most recent record in a table? is that right? When you say the last recorded date, are you referring to the last record created, or the last record edited?

Let me know and I will throw together a quick demo app to show how I would do this.

Pete

---

<div class="post-metadata">

**Author:** ![h.koren](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@h.koren](https://community.tulip.co/u/h.koren)\
**Post date:** [April 13, 2022, 12:10pm UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/5 "2022-04-13T12:10:54Z")

</div>

Hello Pete,  
I’ll explain to you what I want.  
My colleagues have to perform 10 quality checks every week.  
On Monday, the counter should be back at 10.

I was thinking of doing something with week numbers. but then the last recorded date must be looked at.

---

<div class="post-metadata">

**Author:** ![Pete\_Hartnett](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/pete_hartnett/32/3678_2.png) [@Pete\_Hartnett](https://community.tulip.co/u/Pete_Hartnett)\
**Post date:** [April 13, 2022, 12:28pm UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/6 "2022-04-13T12:28:45Z")

</div>

Thanks for the context.

Here is how I would do that-

1. Create a table where you track each week with an inspections column.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/7/787e1d140e1f571156d8465b925069866ef38cc0.png)
2. On step enter, I create or load a record with the YEAR-WEEK NUMBER as an ID.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/f/feb222f64c93668a4d80d43bd3a019e7380aa618.png)
3. If the number of inspections is blank, set it to 10.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/9/9dac666997fa3cc15dbaaac5f2a8ce51067ea796.png)

Does this achieve what you are looking for?  
Pete

---

<div class="post-metadata">

**Author:** ![h.koren](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@h.koren](https://community.tulip.co/u/h.koren)\
**Post date:** [April 14, 2022, 11:42am UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/7 "2022-04-14T11:42:07Z")

</div>

Hello Pete,  
I did it differently now  
First off all we have an Quality check Tablet to do the checks.  
Then we have a Quality monitor in the office.

Quality check app:  
When i do a check i write an integer to the user table

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/9/9f0e83928d45e1bff3d5b302b52cb9f907af5479.png)

Monitoring.  
Evertime when e step is made, the Checkcounter is looking to the user table

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/9/90a515aaa0155c2a43dab121c06f5b41d25d998c.png)  
On Monday morning i Reset this to 0  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/f/fc0aaa91e7cf9b0cd5eb4259a7195622eb621676.png)  
So far it is working!

---

<div class="post-metadata">

**Author:** ![h.koren](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@h.koren](https://community.tulip.co/u/h.koren)\
**Post date:** [April 14, 2022, 11:43am UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/8 "2022-04-14T11:43:40Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/d/d255a3025f66ee392592e94ed87e8647e4fb8ba7.png)

---

<div class="post-metadata">

**Author:** ![Pete\_Hartnett](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/pete_hartnett/32/3678_2.png) [@Pete\_Hartnett](https://community.tulip.co/u/Pete_Hartnett)\
**Post date:** [April 14, 2022, 1:06pm UTC](https://community.tulip.co/t/week-numbers-store-in-tables/4974/9 "2022-04-14T13:06:46Z")

</div>

Nice! Just shows all the different ways you can approach the same problem.

Let me know if you have any issues with your approach.

Pete
