Displaying the current week worth of data in a view

Hi,

Can someone please provide me with the code to display the current weeks worth of documents in a view?

Say today is the 30th November (which it is). I want my view to display all documents from Mon 26th to Fri 30th November. This weeks worth. The field to get this from is called CommitteeDate

I’ve tried using @Adjust and even the @Weekday within it, but am confusing myself.

If anyone can help, I’d be grateful.

Many thanks,

Hayley.

Subject: Displaying the current week worth of data in a view

hay add this condition in your view

SELECT Form=“Department” &

EntryDt < @If(@Weekday(@Today ) = 1;@Adjust(@Today;0;0;-1;0;0;0);@Weekday(@Today ) = 2;@Adjust(@Today;0;0;5;0;0;0);@Weekday(@Today ) = 3;@Adjust(@Today;0;0;4;0;0;0);@Weekday(@Today ) = 4;@Adjust(@Today;0;0;3;0;0;0);@Weekday(@Today ) = 5;@Adjust(@Today;0;0;2;0;0;0);@Weekday(@Today ) = 6;@Adjust(@Today;0;0;1;0;0;0);@Today)

&

EntryDt > @If(@Weekday(@Today ) = 1;@Adjust(@Today;0;0;-1;0;0;0);@Weekday(@Today ) = 2;@Adjust(@Today;0;0;5;0;0;0);@Weekday(@Today ) = 3;@Adjust(@Today;0;0;4;0;0;0);@Weekday(@Today ) = 4;@Adjust(@Today;0;0;3;0;0;0);@Weekday(@Today ) = 5;@Adjust(@Today;0;0;2;0;0;0);@Weekday(@Today ) =6;@Adjust(@Today;0;0;1;0;0;0);@Weekday(@Today ) = 7;@Adjust(@Today;0;0;-5;0;0;0);@today)

Subject: RE: Displaying the current week worth of data in a view

Unless the database contains a very small number of documents, you generally don’t want to use @functions related to the current date or time (like @today, @now, etc) inside of view selection or column formulas.

The reason is that the view is rebuilt each time someone looks at it which causes a severe performance impact.

Could you categorize the view by work week instead?

Subject: RE: Displaying the current week worth of data in a view

Totally agree!Never use the initial approach (unless the database is very small).

You could categorize the view and embed it in a single category form.