Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query to retreive data and compare with Frontend values.

IQFeb 23 2018 — edited Feb 23 2018

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:-

AccountSerialRec IDEnc ReadingCalculated_valueRequired_Value
66284750297353000478500478.500478.500
66284750297353000479000479.000479.000
50583241201519001203912.0391203.900
50583241201519001204112.0411204.100
1837162698541001777117.7711777.100
1837162698541001777317.7731777.300
14397650108757000812000812.000812.000
1252932775591001045510.4551045.500
1252932775591001045610.4561045.600
1252932775591001045710.4571045.700
10176146012142001603016.0301603.000
10176146012142001603116.0311603.100
10176146012142001603216.0321603.200
This post has been answered by mathguy on Feb 23 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2018
Added on Feb 23 2018
5 comments
483 views