Using a select max(blah) as an input parameter
As the comments state, you forgot to include the FROM clause in your SELECT query. Try this:
insert into &quot;MeterData&quot;.data(nmi, intervalend, &quot;E1&quot;, version) values
('E1234', now(), 12.4, (select max(version) from MeterData where nmi = 'E1234' and interalend = now()) + 1)