# 2 Things: Odd Date/Time value and multiple tables into 1 excel sheet

**URL:** <https://forum.inductiveautomation.com/t/2-things-odd-date-time-value-and-multiple-tables-into-1-excel-sheet/85294>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 6, 2024, 1:57pm UTC](https://forum.inductiveautomation.com/t/2-things-odd-date-time-value-and-multiple-tables-into-1-excel-sheet/85294 "2024-02-06T13:57:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [February 6, 2024, 1:57pm UTC](https://forum.inductiveautomation.com/t/2-things-odd-date-time-value-and-multiple-tables-into-1-excel-sheet/85294/1 "2024-02-06T13:57:26Z")

</div>

Hello All, I have 2 questions.

1. There is an odd Date/Time Stamp that is being reported out into Perspective table from SQL. see picture below. When I transfer the date to a .xlsx file, it goes back to a normal format. Just in Perspective it's weird. How do I fix it.  

2. As the picture suggests, i have multiple SQL table being generated on one sheet. More for data gathering rather than actual visual analysis. How can i get all 3 tables into one sheet. I currently have a button that our resident developer assisted us with for a different report. see below. Can I use this to get all of them into one workbook? of so, how?

```auto
	startdate = self.getSibling("DateTimeInput").props.value
	startdatestr = str(startdate)
	enddate = self.getSibling("DateTimeInput_0").props.value
	enddatestr = str(enddate)
	filename = startdatestr+'-'+enddatestr+' Short Raw Data.xlsx'
	data = self.getSibling("Table").props.data
	data = system.dataset.toExcel(True, [data])
	system.perspective.download(filename,data)

```

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [February 6, 2024, 2:09pm UTC](https://forum.inductiveautomation.com/t/2-things-odd-date-time-value-and-multiple-tables-into-1-excel-sheet/85294/2 "2024-02-06T14:09:21Z")

</div>

It's displaying the date in epoc time. You have to add a column definition to format it as a date. The field name has to match.

> [@Perspective table displaying unix epoch date but not in dataset?](https://forum.inductiveautomation.com/t/perspective-table-displaying-unix-epoch-date-but-not-in-dataset/51588):
>
> Using SQL Server 2019 and Perspective 8.1.10. I have a named query that gets a datetime field from SQL Server. The datetime appears correct in the dataset. When I bind the dataset from my named query to the table, it comes in as unix epoch time however. I have not changed anything about the table formatting. It looks like this [image] I have set “render” for this column to “date” and the “dateFormat” to 'MM/DD/YYYY` but I am seeing these unix dates in the table still. Any idea what I am …

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 6, 2024, 2:09pm UTC](https://forum.inductiveautomation.com/t/2-things-odd-date-time-value-and-multiple-tables-into-1-excel-sheet/85294/3 "2024-02-06T14:09:43Z")

</div>

Question 1:

Name the SQL field in each of the `columns.0.field` properties. e.g.  
`columns.0.field : Timestamp`.  
Then the rest of the properties will work.  
`columns.0.render : date`  
`columns.0.dateFormat: YYYY-MM-DD`

Question 2:

> I have multiple SQL table being generated on one sheet.

Perspective doesn't have "sheets". Maybe you mean "view"?

> How can i get all 3 tables into one sheet.

You already have, according to your previous statement.

Can you clarify?

---

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [February 6, 2024, 2:20pm UTC](https://forum.inductiveautomation.com/t/2-things-odd-date-time-value-and-multiple-tables-into-1-excel-sheet/85294/4 "2024-02-06T14:20:11Z")

</div>

There is just one table that it will download the the above code.. do I need to add the other table data names into this part to get separate tabs in the excel sheet? P.S. I don't code.. i dabble as best and can reuse things I already have. I'm Learning 🙂

> [@Ben\_Blaschuk](#):
>
> `data = self.getSibling("Table").props.data`

e.g.

```auto
`data = self.getSibling("Table","Table 2","Table 3").props.data`

```

---

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [February 6, 2024, 2:33pm UTC](https://forum.inductiveautomation.com/t/2-things-odd-date-time-value-and-multiple-tables-into-1-excel-sheet/85294/5 "2024-02-06T14:33:10Z")

</div>

I am going to add to this for us that are not coders. There is a Property on the left that is your column properties. see picture. When you click the "+" it will look like your other columns have disappeared. Have no fear, they are there. Keep pressing the "+" until all of your other columns are visible again. Then you can change the field property information as above to change the date...  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/f/ef3338867e9fabea6e57e2f3d0982c70b299742f.png)

---

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [February 6, 2024, 7:01pm UTC](https://forum.inductiveautomation.com/t/2-things-odd-date-time-value-and-multiple-tables-into-1-excel-sheet/85294/6 "2024-02-06T19:01:37Z")

</div>

I solved question 2... i needed to create the "data" datasets and then add them into the download like shown below. 🙂 YAY ME!!... lol

```auto
startdate = self.getSibling("DateTimeInput").props.value
	startdatestr = str(startdate)
	enddate = self.getSibling("DateTimeInput_0").props.value
	enddatestr = str(enddate)
	filename = startdatestr+'-'+enddatestr+' Short Raw Data.xlsx'
	L1data = self.getSibling("Line 1 Data").props.data
	L2data = self.getSibling("Line 2 Data").props.data
	L3data = self.getSibling("Line 3 Data").props.data
	data = system.dataset.toExcel(True, [L1data,L2data,L3data])
	system.perspective.download(filename,data)

```
