We help IT Professionals succeed at work.

teradata - pulling time information from datetime field

akatz66
akatz66 asked
on
Hello,
   I am trying to pull out the time from a datetime field and I'm having some trouble.  It's fairly easy to do with the date and I'm not sure what I'm doing wrong.  An example of the field is :

2008-08-29 13:05:00

To pull a date, I use the following code:
WHERE
(CAST(tablename.fieldname AS DATE) BETWEEN {(alias) '2010-06-01'} AND {(alias) '2011-04-30'})
Comment
Watch Question

Most Valuable Expert 2014
Commented:
try tablename.fieldname (format 'HH:MI') (varchar(80)) between '00:01' and '23:59'

Explore More ContentExplore courses, solutions, and other research materials related to this topic.