Question: I create column in this way:

```
ALTER TABLE cages
ADD test date;

```

I add date to this column

for instance

'01/07/21'

and when I use like always select:

```
select *
from cages
where test = '01/07/21';

```

I get nothing, it's weird, because in different table it's works... Can it connection with pk or fk or what is the reason of this?

edit:

I use SQL orlace developer.

[![enter image description here](https://i.stack.imgur.com/V00xL.png)](https://i.stack.imgur.com/V00xL.png)

edit:

thanks everyone for help, problem was that I used calendar to put date to column and it add date with time.

Why is it possible, when I have type date not dateTime?

Answer: 
Your root problem, and I'm amazed no one seems to have picked up on this, is that your column is a DATE but in your query you are comparing it to a STRING. This may or may not work, depending on your NLS\_DATE\_FORMAT setting. You need to compare like data types:

```
select *
from cages
where test = to_date('01/07/21','dd-mm-yy');

```

I leave it as an exercise for the student to go to the [SQL Reference](https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/index.html) manual and read up on the TO\_DATE function.

I also beg and plead with you to not be trying to use 2-digit years. As an industry we were supposed to have solved that problem over 20 years ago. Does the term "Y2k bug" not mean anything to you?

As it is, the date that is represented by the string '01/07/21' could be understood to be any of the following

* Jan 7
* Jan 21
* Jul 1
* Jul 21

And who knows the year? 2021? 1921? 1821? 2001? 1901? 2007? 1907?, 1807?

You might want to read [this](https://edstevensdba.wordpress.com/2011/04/07/nls_date_format/).
Using SQL Developer if you insert a date in a table using user interface it automatically generates hours and minutes like if it's a Timestamp. If the format you are using is correct you should be able to retrieve your rows using `like` operator instead of `equal`.

```
select * from cages where test like '01/07/21%';

```

The only way to retrieve your rows using `equal` operator is when the timestamp is set to 00:00:00