Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateRange Selection Formula 1

Status
Not open for further replies.
Sep 27, 2001
179
0
0
AU
Hi

Wondering if anyone can help:

I need a formula to be able to restrict records in a report to only those that fall between now and the end of the following week, e.g. today is Monday 7th July so just records between and including Friday 18th July.

Thanks

Rob Colborne
 
Place in your record selection formula :

{DateField} >= CurrentDate and
{DateField} <= (CurrentDate + 14 - Dayofweek(currentDate,crSaturday))

Let me know how you get on..........

Reebo
Scotland (Sunny with a Smile)
 
Hi, just wanted to add one thing...generally as far as possible try avoid using selection formula...just because, it fetches all the records at the client side and then filters them. Thus it increases network traffic, takes lot of time to process. I agree the we can not notice the difference if records are less...but if they are huge ..u sure can.

Thanks
Anish
 
may be i was wrong...i thought i was in VB section. sorry. but if we are in vb and using ocx control of cr, i used to avoid using recordselectionformula.
 
Anish,

That's a rather general and not necessarily true statement. The point of specifying a selection criteria is to minimise the records you return, and so minimise database traffic. Unless your datasource is very specific, like a tailored view or stored procedure, I cannot see how not specifying a selection criteria is going to help you with performance.

There are numerous ways to say the same thing in your selection criteria in Crystal. Some of them will pass to the database, and others - usually which include functions which Crystal needs to evaluate - will not. It is up to you to check what is being passed to the database by checking the Show SQL Query option under the Database menu. If it's not passing, try saying your selection criteria in a different way. You can additionally direct processing away from the client by checking the Perfom Grouping on Server option.

Naith
 
I think we must have posted our latest responses at the same time. I wish the boards had an update lockout system! ;)

Naith
 
yes...they should have. :)
btw ur reply is more through. Thanks..actually i had not worked on CR since 1 and a half year or so, hence i was trying to refresh myself. and u did that. thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top