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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LAST8DAYS FORMULA 3

Status
Not open for further replies.

Nmartin95

MIS
May 29, 2002
19
US
Does any body know a formula that gets dates for the Last8days rather than using Crystal 7.01's Last 7 days. Any help would be greatly appreciated.
I am currently having a problem now when I run a report for the last7days and it is not giving me the dates for the last 7 days. For example,the report basically shows all tickets closed for a certain analyst. If I run it on Thursdays at 11:59pm, I am supposed to get tickets closed from that Thursday to last Friday (May 24th - 30th). The report is only giving me from last friday to wednesdays stats (May 24th-29th), and I know analysts have closed tickets yesterday.
Thanks
 
Have you tried something like this?
{your date field}> = CurrentDate - 8
 
{Datefield} in Cuurentdate to Dateadd("d",-8,Currentdate)

should work. You can of course replace CurrentDate with a parameter field. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Please note, this option only works if you're connecting to a SQL Type Database such as Oracle or SQL Server:[ol][li]Create a SQL Expression[/li]
//%DateMinus7
//Your syntax may differ slightly

sysdate - 7

[li]Edit your record selection[/li]
//This criteria will return records
//for the last 8 days (including today)

{table.date} in {%DateMinus7} to CurrentDate[/ol]The reason you should use a SQL Expression is because this criteria will be passed to the DB Server, whereas the other options will force processing to occur on the client side. Depending on the size and integrity of your DB tables and the client machine's processing power and available disk space, this may not be an issue or it may be a very large issue. Just yesterday, I optimized a colleague's report by changing the date-based record selection critiera to not use a formula. The report now runs in <1 Minute Vs. ~20-30 Minutes.

I believe that report writers should always look for ways to optimize reports for maximum efficiency.
 
Thanks Guys, both formulas worked thanks for the help..greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top