Hi everyone,
I am using the Query shown below to retrieve records. The value obtained in the column Calcluated_value should be the same as Required_value which is a column I have added here to the putput for comparing this with the front end screen of the application, how can I modify my query so that it shows the calculated_value to be the same as the front end values which I have shown here in Required_value column.
Thanks
IQ
Query:-
select distinct
AccountSerial,a."Rec ID",
a."Enc Reading", ,
STR from dual(CAST(a."Enc Reading" AS NUMBER(18,0))/1000,LENGTH(RTRIM(a."Enc Reading"))+2,3 ) "Calculated Value",
-- Required_value are the values obtained from Front-end GUI application
from "Enc Reading Trans" a,
"Account Enc Xref" b
where a."Rec ID" = b."Rec ID"
and CONVERT(date, a."Reading Time") between '2017-01-06' and '2017-01-06'
and ISNUMERIC("Enc Reading") = 1 and AccountSerial in(101761,125293,505832,662847,183716,143976)
order by AccountSerial desc
Output:-
| AccountSerial | Rec ID | Enc Reading | Calculated_value | Required_Value |
| 662847 | 50297353 | 000478500 | 478.500 | 478.500 |
| 662847 | 50297353 | 000479000 | 479.000 | 479.000 |
| 505832 | 41201519 | 0012039 | 12.039 | 1203.900 |
| 505832 | 41201519 | 0012041 | 12.041 | 1204.100 |
| 183716 | 2698541 | 0017771 | 17.771 | 1777.100 |
| 183716 | 2698541 | 0017773 | 17.773 | 1777.300 |
| 143976 | 50108757 | 000812000 | 812.000 | 812.000 |
| 125293 | 2775591 | 0010455 | 10.455 | 1045.500 |
| 125293 | 2775591 | 0010456 | 10.456 | 1045.600 |
| 125293 | 2775591 | 0010457 | 10.457 | 1045.700 |
| 101761 | 46012142 | 0016030 | 16.030 | 1603.000 |
| 101761 | 46012142 | 0016031 | 16.031 | 1603.100 |
| 101761 | 46012142 | 0016032 | 16.032 | 1603.200 |