Curent Date filter for inbox.

1 view
Skip to first unread message

aba

unread,
Jun 2, 2008, 8:04:26 AM6/2/08
to orangescape.dimension
This works with mssql 2000 and mssql 2005.
please check with other databases.

The only requirement for this is that the field which you are setting
as a filter should hold the value of today() and not that of now(),

field in (select convert(char(10),getdate(),103) from <table
name>)
or
field = (select convert(char(10),getdate(),103))

if you have use now() function then you will have to set the filter
this way

field > (select convert(char(10),getdate(),103))
field < (select convert(char(10),getdate()+1,103))

if it is for a range of dates like get those transactions which are
pending for more than ten days, you can use it like this

field < (select convert(char(10),getdate()-10,103))

Balaji VG

unread,
Jun 3, 2008, 5:22:59 AM6/3/08
to orangescape.dimension
Anbu,

I think you missed out some thing, relevant with filtering the date in
MS SQL.


Example.. i am filtering records based on the <<created_date>>
column. Date format is "YYYY-MM-DD".

In the left side of the filtering option in editer preference, i
select <<created_date>> field.

In the right side, i give the following statement.

"created_date and cast(datepart(yyyy,created_date) as varchar(4))+'-'+
cast(datepart(mm,created_date) as varchar(2))+'-'+
cast(datepart(dd,created_date) as varchar(2))
=(cast(datepart(yyyy,getdate()) as varchar(4))+'-'+
cast(datepart(mm,getdate()) as varchar(2))+'-'+
cast(datepart(dd,getdate()) as varchar(2)) )"

In the middle, that is operator box, you can select any operator like
=,>,< . But the same operator should placed in the middle of right
side statement.


Balaji VG.

aba

unread,
Jun 3, 2008, 11:20:20 PM6/3/08
to orangescape.dimension
> In the right side, i give the following statement.
>
> "created_date and cast(datepart(yyyy,created_date) as varchar(4))+'-'+
> cast(datepart(mm,created_date) as varchar(2))+'-'+
> cast(datepart(dd,created_date) as varchar(2))
> =(cast(datepart(yyyy,getdate()) as varchar(4))+'-'+
> cast(datepart(mm,getdate()) as varchar(2))+'-'+
> cast(datepart(dd,getdate()) as varchar(2)) )"
>

actually in dimension inbox filter it will work in this way itself

created_date = (cast(datepart(yyyy,getdate()) as varchar(4)) +'-'+
cast(datepart(mm,getdate()) as varchar(2)) +'-'+
cast(datepart(dd,getdate()) as varchar(2)) )
Reply all
Reply to author
Forward
0 new messages