Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Query to return the difference of dates between records - forum topic by Riny

$
0
0

Hi All,
I have a table with policy no,status code,status date.
I want to get the difference of the status dates for each policy(will have more than one record with different status codes)after getting sorted with the status dates for each policy.
The difference of the status dates should only consider certain status codes.
for eg: consider that 5,6 are the status codes to be considered

pol 1

5

1st june

pol 1

6

2nd june

pol 1

7

4th june

pol 1

6

6th june

pol 1

8

9th june

pol 1

9

10th june

pol 1

10

11th june

i should get the op as

pol 1

6

which is difference of (4th june-1st june)+(9th june-6th june)

Tags: 
Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>