Aug 4, 2008 #1 ekta22 IS-IT--Management Joined May 3, 2004 Messages 359 Location US Hi, I have a datetime field and I was to extract just the hour portion of that in my SQL statement. Any ideas on how to do this? I tried to look around but did not find anything. Thanks, -E
Hi, I have a datetime field and I was to extract just the hour portion of that in my SQL statement. Any ideas on how to do this? I tried to look around but did not find anything. Thanks, -E
Aug 4, 2008 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR SELECT CAST(yourDateTimeColumn AS TIME) ... Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
Aug 4, 2008 #3 Ascalonian Programmer Joined Jan 4, 2008 Messages 264 Location US Try this... Code: SELECT EXTRACT(HOUR FROM SYSDATE) Upvote 0 Downvote
Aug 4, 2008 #4 r937 Technical User Joined Jun 30, 2002 Messages 8,847 Location CA mikey, nice ANSI well, except for the SYSDATE ;-) r937.com | rudy.ca Upvote 0 Downvote