• well since I am not an SQL programmer, I have been left with fixing what someone else started.

    essential I have a timestamped table that records tank levels every 1 minute. the level transmitters are the tagname. I have about 30 tanks. when the tank is empty or the data recorded could be less than 0. In another table I have the tank strapping tables that convert the data from the level transmitters to gallons. I am trying to produce a table where I can grab the level transmitter value and then get the gallons in the tank based on the timestamp value.

    if the value recorded is less than 0, the tank does not appear in the results.

    here is a sample of the results table