Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Pulling weekend orders ahead into report Post Reply Post New Topic
Author Message
tondalynn88
Newbie
Newbie


Joined: 28 Oct 2008
Online Status: Offline
Posts: 7
Quote tondalynn88 Replybullet Topic: Pulling weekend orders ahead into report
     Posted: 07 Jan 2013 at 10:28am

Hello- I have a report that I need to run via BOE on that pulls all orders due 2 days ahead ot the requested due date.  For example when the report runs on Monday it pulls in Wed, ran on Tues pulls in Thur, ran on wed pulls in Fri, etc. Thursdays I am getting hung up as I need it to pull in orders that are due on Sat, Sun and Mon .  Friday would pull in Tuesday.

I am probably way over thinking this but I just cant get the range (Sat-Mon) to pull in to Thurs report.

If I was running this adhoc I would just say where vdatu is between 1/5-1/7 but since this will run via BOE, I need a formula that will give me those results.

Any ideas???
IP IP Logged
Matt
Newbie
Newbie
Avatar

Joined: 04 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 19
Quote Matt Replybullet Posted: 07 Jan 2013 at 11:42pm
In the example below. ?Date is a date parameter I am entering but it could just be the current date.  Based on the dayofweek value of that date (6 means Friday) im either extracting for the current + 2 days or + 4 days
 
if DayOfWeek ({?Date}) = 6 then
{Sheet1_.Date} = DateAdd("d", 4, {?Date})
else
{Sheet1_.Date} = DateAdd("d", 2, {?Date})
 
Give it a whirl.
 
M.
With all due respect.
IP IP Logged
tondalynn88
Newbie
Newbie


Joined: 28 Oct 2008
Online Status: Offline
Posts: 7
Quote tondalynn88 Replybullet Posted: 08 Jan 2013 at 8:20am
I'll give it a go!  Thanks!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jan 2013 at 9:06am
just a bit of a suggestion, you do not need to use if-then in the select statement but rather an or option.
 
(weekday(currentdate) in [2,3,4] and dateadd('d',2,currentdate)={table.requestdate})
or
(weekday(currentdate)=5 and {table.requestdate} in dateadd('d',2,currentdate) to dateadd('d',5,currentdate))
or
(weekday(currentdate) = 6 and dateadd('d',4,currentdate)={table.requestdate})


Edited by DBlank - 08 Jan 2013 at 9:06am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum