filtering on date values so far we've
just filtered on text and number values
what if you want to filter on dates
filtering on dates is a little different
but I'll show you how easy it can be to
filter on a date value you can do it in
two ways you can enter it inside single
quotes in the default format of your
database or you can use a function we'll
explain how to use a function in a later
lesson but for now let's take a look at
a filter on date values in this lesson
we're going to filter this data on a
date value let's see what data we have
in our employees table we can see our
data here now let's say we want to
filter on the higher data column we only
want to show records where the employee
hire date is equal to 3rd of October
2010 in our query we're putting the word
where and then higher underscore date
because that's our column and then an
equal sign then we enter our dates
inside single quotes it needs to be in a
specific format which is different to
the output format here the format needs
to be the two-digit day and then a dash
and then the three words for the month
and then a dash and then four digits for
the year I'll show you how to find this
exact format in a moment because it can
depend on which country that you're
running this in now let's run the query
we can see there is one record that
matches this hire date now to find out
what date format that your database
expects if it's different to this you
can run this query here select a value
from ein LS underscore database
underscore parameters where parameter
equals n LS date format if you run this
it will give you the output value here
now this table will show you a range of
database parameters and what it includes
is the date format that the database
expects and the DD is the day into
digits then we have a - and then mo n
which is the
one thing three letters then - an R
which is the year in either 2 or 4
characters so let's go back to our
results of our first query here we can
say the data only shows the single
record
now what about greater then we don't
always have to match on equals we can
use any of the operators that we've
looked at so far what about employees
with a higher date is before the first
of October 2010 we can go less than here
and then change the row 3 to 0 1 let's
run this query we can see all of these
employees here and their hire date is
earlier than 1st of October 2010 now
what about greater than we can change
this to greater than and change the data
if we want let's say the 23rd of January
2012
you can see it shows all the records
where the hire date is greater than the
23rd of January 2012 you can also run
this as greater than or equals to this
way it will include any records that
have that exact hire date so that's how
you can use dates in our where clause
next we'll look at how to use multiple
filters in a single query