Evaluation Errors in my dateTime tags and my Expression Tag

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.

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

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

Oven On ValueChange:

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

Target Temp Reached ValueChange:

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

Target Temp Expression:

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

Seconds Since Target Temp Reached Expression:

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

Getting a type conversion error currently.

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.

Those are memory tags in mine, not SQL tags.

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?