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

Get Most Current Date - forum topic by ca8172

$
0
0

Good Day All,
This is my first time posting and have looked for help here before, but can't seem to figure out what I need to do.  So I figured I would reach out and ask for assistance pertaining to my query.
I need to run a query that allows me to pull out data that has the most current date.  Below is the query I am using:
select ca8172.*
,ord.order_due_dt as ORD_DUE_DT
,ord.cust_reason_txt as RSN_TXT
,ord.order_reason_cd as ORD_RSN_CD
from ORDER_ACTION ord, ca8172_AcctCharge ca8172
where ord.acct= ca8172.acct
and ord.bypass_reason_cd = 'VS'
and ord.current_status_cd = 'DO'
and ord.order_reason_cd in ('VA','ML','DR')
When I run the query, the information looks like this:
ACCT      -- CODE -- CHG DT  -- CHRG -- ORD DUE DT -- RSN TXT -- ORD RSN CD
1598753 -- IPTV    -- 6/1/2013 -- 5.00    -- 5/1/2013       -- Voluntary -- VA       
1598753 -- IPTV    -- 6/1/2012 -- 5.00    -- 5/9/2012       -- Voluntary -- VA       
1598753 -- IPTV    -- 2/1/2012 -- 5.00    -- 1/13/2012     -- Voluntary -- VA      
What I would like to do is isolate the most current date; in this instance 05/01/2013 in the Order Due Date so that all other date (05/09/2012 & 01/13/2012) are no longer relevant.  How do I go about doing that?  Any assistance would be appreciative.
Thanks!

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>