Query In SSRS


hi,

i want query users did not visit website past 3 years. how write query this. tried using calculated formula

=datediff("yyyy",fields!scheduled_date.value,now())>= 3. calculated column shows false each row , shows error "the value expression field ‘sch_date’ contains error: operator '>=' not defined type 'date' , type 'integer'".

and want group report user name. tried using group results weird. each row showed username.

any ideas please?

thanks


hi fadnan,

thanks question. based on description, understand type of scheduled_date date/time, compare scheduled_date’s value value of now() function on year level, however, displays error of type conflict.

actually, there 2 different actions requirement, 1 in t-sql query level, 1 add filter on dataset, in action, please remember setting expression’s data type of datediff("yyyy", fields!scheduled_date.value, now()) integer, detail steps below,

action one, using datediff () function in t-sql query of dataset, this:

select scheduled_date from tablename where datediff(yyyy, scheduled_date,getdate())>3


action two, using
datediff () function in filter of dataset, detail steps below,

1. type in dataset’s query dialog box this,

select scheduled_date from tablename

 

2. right-click handle of detail row in tablix, select tablix properties.

 

3. in tablix properties dialog box, click filters in left pane.

 

4. click add button, click fx button on right of expression drop-down list, type in expression dialog box this:

=datediff("yyyy",fields!currenttime.value,now()), click ok.

 

5. select integer in drop-down list of type, select > in drop-down list of operator, type 3 in text box of value,click ok.

 

if issue still exsits, please feel free let me know.

 

thanks,
sharp wang


best regards. sharp wang


SQL Server  >  SQL Server Reporting Services, Power View



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607