0

I know this is simple but am having great difficulty, I need to take a query field that is datetime and convert it so that it is only date no time.

 SELECT COSTLABR.CHARGDTTM
 FROM imsv7.costlabr

Gets me the datetime field from chargdttm but I need it to only be date, or as an alternative the time to be exactly the same for every row returned.

This has got to be simple but it is eluding me. Thanks in advance! Steven

1 Answers1

0

You can use the TRUNC function to truncate dates:

SELECT TRUNC(COSTLABR.CHARGDTTM)
   FROM imsv7.costlabr

will set the HOURS, MINUTES, and SECONDS portions of the date column to zero, in effect changing the time to the preceding midnight.