Filter by Date

Posts   
 
    
methodman
User
Posts: 194
Joined: 24-Aug-2009
# Posted on: 02-Feb-2012 11:16:29   

Hi,

I have a Date type column where are values in this format

1.1.2012 10:10:11

I need to create a filter which would filter these values by day, month and year.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Feb-2012 12:27:23   

How would you do it in plain SQL?

methodman
User
Posts: 194
Joined: 24-Aug-2009
# Posted on: 02-Feb-2012 13:03:58   

I'd create a between filter with 1.1.2012 0:00:00 and 1.1.2012 23:59:59.

I was just wondering if there any other way.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Feb-2012 13:14:45   

In SQL you can Use DATEPART() function.

Similarly you can use it, by utilising DbFunctionCall