Question: I want to display all customers who placed an order during 2010. When I display "customerid" and "orderdate" from the custorder table, the format looks like this:

```
C-300064    06-DEC-10

```

Basically I need to figure out how to get it to display only customerid where the last 2 digits of orderdate are 10.

Can someone help me out please?

Answer: 
> 
> I'm wanting to display all customers who placed an order during 2010.
> 
> 
> 

As simple as:

```
SELECT  customerid , orderdate
FROM your_table
WHERE orderdate >= DATE '2010-01-01' AND orderdate < DATE '2011-01-01';

```

If orderdate is `DATE` column then how it is displayed doesn't matter. `DATE 'YYYY-MM-DD'` literal does not depend on your session `NLS_DATE_FORMAT`.
If you are using Oracle, you have several ways to achieve this using a WHERE clause on the "orderdate" column. However, when using Oracle SQL, you may need some additional code to account for different date formats. I believe these examples should work for you:

```sql
SELECT t1.customerid, t1.orderdate
FROM some_table t1
WHERE t1.orderdate BETWEEN '2017-01-01' AND '2017-12-31';

SELECT t1.customerid, t1.orderdate
FROM some_table t1
WEHRE t1.orderdate > '2016-12-31' AND  t1.orderdate < '2018-01-01';

SELECT t1.customerid, t1.orderdate
FROM some_table t1
WHERE NOT ('2017-01-01' > t1.orderdate OR '2017-12-31' < t1.orderdate);

```

The BETWEEN method takes a little longer to process, so I would recommend the bottom two options (WHERE and WHERE NOT).

I've built a fiddle that shows these three examples: <http://sqlfiddle.com/#!9/38063/1>

Good luck!