# Evaluation Errors in my dateTime tags and my Expression Tag

**URL:** <https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [May 31, 2018, 7:43pm UTC](https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248 "2018-05-31T19:43:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [May 31, 2018, 7:43pm UTC](https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248/1 "2018-05-31T19:43:34Z")

</div>

I’m having problems getting the correct output/value for these tags and I am also getting an evaluation error in the quality for my tags. Note that I made the return values for the if statements the same just to test if that had any impact on the quality. I am trying to write values to certain dateTime tags if certain conditions are met. Those dateTime values are then sent to another tag where they should be evaluated to generate a final value, but I am getting an evaluation error for all three of them.

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 31, 2018, 7:47pm UTC](https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248/2 "2018-05-31T19:47:23Z")

</div>

You can right-click on the tags and click “Tag Diagnostics” to find more specific debugging information.

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 31, 2018, 8:01pm UTC](https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248/3 "2018-05-31T20:01:22Z")

</div>

I did a little test to show the process more clearly:

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/f5b3c74a9dc600e7e4f4bb262d9b0d6f1ce76f98.png)

**Oven On ValueChange:**

```auto
	if initialChange:
		return
		
	if previousValue.value == False and currentValue.value == True:
		system.tag.write("[.]Time Oven Start", system.date.now())

```

**Target Temp Reached ValueChange:**

```auto
	if initialChange:
		return
		
	if previousValue.value == False and currentValue.value == True:
		system.tag.write("[.]Time Set Temp Reached", system.date.now())

```

**Target Temp Expression:**

```auto
({[.]Oven Temp} >= {[.]Set Temp})

```

**Seconds Since Target Temp Reached Expression:**

```auto
if ({[.]Oven On} && {[.]Target Temp Reached},
	secondsBetween({[.]Time Oven Start}, {[.]Time Set Temp Reached}),
	-1
)

```

EDIT: Seconds Since Target Temp Reached Tag would be better named: Seconds Taken To Reach Target

---

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [May 31, 2018, 8:21pm UTC](https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248/4 "2018-05-31T20:21:27Z")

</div>

Getting a type conversion error currently.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/581f2447597641e40fc77fadb55fe53ccab73b30.PNG) ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/eb3506b80f10988e479c9bed0e6578d093a0f026.PNG)

---

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [May 31, 2018, 8:46pm UTC](https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248/5 "2018-05-31T20:46:06Z")

</div>

I fixed the issue, however, I was wondering what you put for the SQL queries in the DateTime tags that you wrote to considering that they will not run unless you put something inside them because of the empty query error.

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 31, 2018, 9:05pm UTC](https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248/6 "2018-05-31T21:05:13Z")

</div>

Those are memory tags in mine, not SQL tags.

---

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [June 1, 2018, 2:23pm UTC](https://forum.inductiveautomation.com/t/evaluation-errors-in-my-datetime-tags-and-my-expression-tag/18248/7 "2018-06-01T14:23:02Z")

</div>

something weird is happening where I am getting a reference not found error for my ramp up duration tag if my current oven temperature is less than set temperature. When this happens, my value defaults to the false condition in my if statement which is 0. How can I make it so it continues to display the ramp-up time even after the current temperature is not equal to the set temperature, say until the oven turns off?
