Hi @amateurviz1 and welcome to the Grafana forum.
The only way that I know how to do this is to use Flux. You are currently using InfluxQL. If you are not invested too far into writing your queries using InfluxQL and this type of query is important enough, you should be able to change from InfluxQL to Flux. Here and here are some potentially helpful links.
In Flux, assuming you are using nanosecond precision, I believe you can create a new column by converting the timeRangeStart and timeRangeStop timestamps to int, subtracting, and then converting from nanoseconds to hours:
from(bucket: "Bucket1")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "your-measurement")
|> filter(fn: (r) => r["_field"] == "your-field")
|> map(fn: (r) => ({ r with PeriodTime: float(v: uint(v: v.timeRangeStop) - uint(v: v.timeRangeStart))/float(v:3600000000000)}))