Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

cast date between 2 different data types - response (2) by shaves

$
0
0

select
cast (cast (jsdate as Char (8)) as date format 'yyyymmdd') as Date_Col,
jsdate,
jsn,
junit,
jmyear,
jmake,
jmodel,
jseries,
jbuyid
from veh_mgmt_as400.cs087p
where jfinowngp = 'p1'
and jfinownbr = '99'
and date_col between '06/01/2015'  and '01/31/2016'
Carlos...........Thanks for looking at this.  My sql is above and I tried to incorporate your suggestions but I obviously missed something becuase I'm getting a "Select Failed.  [2666] Invalid date supplied for CS087P.JSDATE.  This is a pretty simple query but dates and cast make me crazy.  Thanks for your help


Viewing all articles
Browse latest Browse all 27759


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