# \#sql

**URL:** https://forums.softvelocity.com/tag/sql/5.md

[Latest](https://forums.softvelocity.com/latest.md) · [Categories](https://forums.softvelocity.com/categories.md) · [Tags](https://forums.softvelocity.com/tags.md)

---

## [DATETIME arithmetic: a hand-built date-time wraps negative](https://forums.softvelocity.com/t/datetime-arithmetic-a-hand-built-date-time-wraps-negative/137)

<div class="topic-metadata">

**Author:** [@rzaunere](https://forums.softvelocity.com/u/rzaunere)\
**Replies:** 0\
**Last updated:** [October 5, 2026, 12:50pm UTC](https://forums.softvelocity.com/t/datetime-arithmetic-a-hand-built-date-time-wraps-negative/137 "2026-10-05T12:50:02Z")

</div>

Checked on build 14407, 10-05-2026. Symptom. dt = d \* 86400 + (t - 1) / 100 with a DATE and a TIME gives a negative or nonsense DATETIME for any current date. Cause. DATE, TIME and the constant are all integers, so the…
