Support DATETIME - TIME

This commit is contained in:
Dianne Skoll
2020-01-01 18:00:22 -05:00
parent aa830116ea
commit ff85325886
2 changed files with 8 additions and 5 deletions

View File

@@ -854,8 +854,9 @@ static int Subtract(void)
return OK;
}
/* If it's a datetime minus an int, do subtraction, checking for underflow */
if (v1.type == DATETIME_TYPE && v2.type == INT_TYPE) {
/* If it's a datetime minus an int or a time, do subtraction,
* checking for underflow */
if (v1.type == DATETIME_TYPE && (v2.type == INT_TYPE || v2.type == TIME_TYPE)) {
v1.v.val -= v2.v.val;
if (v1.v.val < 0) return E_DATE_OVER;
PushValStack(v1);