Question

I am trying to get number of day differences using Floor function between a date and a datetime field. But i am getting one extra day. This is how I`m doing->

SELECT col,col1,FLOOR(col-col1) FROM tab_name

Here col is just Date field,Col1 is DateTime Field

Any idea?

Was it helpful?

Solution

There is no Date without time in oracle.
A date always contains the time as well (even if you don't show it).

I don't see why you're using floor, I think you want trunc ie:

SELECT col,col1, col- trunc(col1) FROM tab_name
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top