# Issue with date retrieval from database?

**URL:** <https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [March 17, 2020, 1:20pm UTC](https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161 "2020-03-17T13:20:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 17, 2020, 1:20pm UTC](https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161/1 "2020-03-17T13:20:57Z")

</div>

I picked date using datetime input component and saved in database:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/ba3df88c43aec2ce04e222f69faa8230715662b6.png)

now when I am retrieving it using following query to perspective table its showing wrong value:  
SELECT expense.expenseId,  
expense.employeeName,  
expense.description,  
expense.job,  
expense.cdnTotal,  
expense.usdTotal,  
expense.euroTotal,  
expense.expenseDate,  
expense.selected  
FROM expense

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0a84df7675f954ae52a841427dc30b60ecbba9f0.png)

Thank You

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sunny/32/13319_2.png) [@Sunny](https://forum.inductiveautomation.com/u/Sunny)\
**Post date:** [March 17, 2020, 2:32pm UTC](https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161/2 "2020-03-17T14:32:18Z")

</div>

You’ll need to configure the props.columns section of your table. The props.columns[x].field should be equals to the column name, set your props.columns[x].dateFormat as you like and if needed, force the props.columns[x].render to date.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 17, 2020, 6:14pm UTC](https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161/3 "2020-03-17T18:14:22Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6137c10c03e31eb4c8d662dce97a402589807584.png)

Since data is fetched from database there is no props.columns

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 17, 2020, 6:33pm UTC](https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161/4 "2020-03-17T18:33:51Z")

</div>

i added columns and tried still not working  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c50578bbe68cf9f11a365804103b036a053ed478.png)

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sunny/32/13319_2.png) [@Sunny](https://forum.inductiveautomation.com/u/Sunny)\
**Post date:** [March 17, 2020, 6:34pm UTC](https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161/5 "2020-03-17T18:34:40Z")

</div>

The props.columns can be auto generated by your dataset with the system.dataset.getColumnHeaders. If you want to have some flexibility on your table, the columns attribute is the way to go.

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sunny/32/13319_2.png) [@Sunny](https://forum.inductiveautomation.com/u/Sunny)\
**Post date:** [March 17, 2020, 6:35pm UTC](https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161/6 "2020-03-17T18:35:39Z")

</div>

You need to set the field with the column’s name.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 17, 2020, 6:39pm UTC](https://forum.inductiveautomation.com/t/issue-with-date-retrieval-from-database/33161/7 "2020-03-17T18:39:47Z")

</div>

Thank You so much you solved my two issues with this.
