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!

LastFullWeek function in CR

Status
Not open for further replies.

gennaroalpha7

Technical User
Nov 28, 2012
253
US
Hi, I am relatively new to CR and I am looking for help. I have a rpt that I automatically run on Mondays, but I would like to just capture the data from the week before i,e., Monday - Sat. Can someone please give me the complete code and instruct me as to where I add it in CR.

Thank you.
gennaroalpha7
 
there are several books out there and lots of reference web sites but without a doubt I have learned the most from reading over posts and solutions on this website.

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
I will note that for future reference...thank you.

Happy Holidays. Take care of you.

gennaroalpha7
 
Hello CoSpringsGuy,

Good morning, just curious. On your last code post...Is there a simpler way of doing this?

Thanks.

gennaroalpha7
 
which code?

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
8 posts up...

This one...from yesterday.

ok im gonna start over because I have been all around the board ..

first create a formula in formula workshop.. right click formula fields and select new and name it crDate.. inter the following code and save it
date(
tonumber(split({Calllog.RecvdDate} ,"-")[1])
,
tonumber(split({Calllog.RecvdDate} ,"-")[2])
,
tonumber(split({Calllog.RecvdDate} ,"-")[3])
)

then go to repport - selection formula - record and enter
{@crDate} in lastfullweek

then run the report
that will give you Sunday through Saturday of the previous week..


Thanks.
gennaroalpha7
 
i may have taken the long road (I tend to do that sometimes) so try this (if it does work though .. just look at all the other functions you learned! LOL)
scrap everything I told you and enter this in the record selection formula

date({Calllog.RecvdDate}) in lastfullweek
//that will give you Sat through Sun

If that works the great! I think it will.

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
on the code that you gave me (the long one)

when I ran the report yesterday...these are the dates that came up....does that look right from your perspective? I think so. from

2012-11-18
2012-11-19
2012-11-20
2012-11-21
2012-11-24
 
yep... the last code should work in record selection formula

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
I added the code:

date({Calllog.RecvdDate}) in lastfullweek

to record selection but I recieved a bolean error. As in your previous code (long one), am I supposed to delete the crDate?

Thx.
 
Hi, It worked.

I substituted

date({Calllog.RecvdDate}) in lastfullweek

in place of the crDate.

I ran it and got the same dates. Success!

Thanks.
gennaroalpha7
 
glad it worked ..

date({Calllog.RecvdDate}) in lastfullweek

should be the only thing in the record selection formula.
delete the formula crDate. You dont need it at all

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top