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/).
1st July 2021 is written `date '2021-07-01'` in Oracle SQL.

You can read more about literals in the [Oracle SQL Reference](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Literals.html).

You *can* also use a `to_date` expression like

```
to_date('2021-07-21','YYYY-MM-DD')

```

or

```
to_date('1-Jul-21', 'DD-Mon-YY', 'nls_date_language = English')

```

or indeed

```
to_date('1-Lug-21', 'DD-Mon-YY', 'nls_date_language = Italian')

```

but frankly, why would you?

Bear in mind that that the person running the query/report/procedure, or the application server in use, may not have the same territory and language settings as you, so it is dangerous to assume that the century for a 2-digit year will always be what you expect (what year is '50'?) or the language will always be English, or the week always starts on a Monday. I worked on a system once where we deployed some code that used 'DD-MON-YYYY', to offices in London and Paris. We deployed it in September, and we had a production issue in Paris in February, because *Sep, Oct, Nov, Dec* and *Jan* still worked, but French has no *Feb*.