Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Only show Ship Dates Post Reply Post New Topic
Author Message
MarkW
Newbie
Newbie
Avatar

Joined: 19 Nov 2013
Location: Canada
Online Status: Offline
Posts: 3
Quote MarkW Replybullet Topic: Only show Ship Dates
     Posted: 20 Nov 2013 at 8:26am
Hi, I'm pretty new to CR (2008 V12.3.0.601).

I have to write a report which gives the ship date for a specific time period. For example; On December 15th 2013 I need the report to show all sales which shipped between October 1st 2013 to October 15th 2013. Secondly on December 31st 2013 the report will show all sales shipped between October 16th 2013 to October 31st 2013.

Here's the code I have:
If {SORMASTER.ReqShipDate} >=  DATETIME (2013, 10, 01)
AND
{SORMASTER.ReqShipDate} <= DATETIME (2013, 10, 15)
AND {SORMASTER.OrderStatus} = "9"
Then {SORMASTER.ReqShipDate}

When I run the report I get the all of the items which shipped in October 2013. I assumed that the 9 would show only items which had shipped (Syspro) and not display any other items. Out of the  Six pages of data returned only Two pages contain the correct date range required.

Any help would be gratefully received.

Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Nov 2013 at 8:52am
You are not really doing any selection with your formula.
To limit your records for a report you use the select expert (the icon is  hand selecting a red ball).
when you open that you can get into the formula editor. here you can add a statement that will act like a "WHERE" clause in sql. It should be a boolean evaluation of each row. TRUE=include FALSE=exclude
 
Yours will look something like
 
{SORMASTER.ReqShipDate} in DATE(2013, 10, 01) to DATE(2013, 10, 15) AND {SORMASTER.OrderStatus} = "9"
 
If you wanted it to be predicated on the day you run the report you can do that as well. Something like
 
{SORMASTER.ReqShipDate} in Aged0To30Days AND {SORMASTER.OrderStatus} = "9"
 
If you always need it the 15th to the end of the month can you explain further the rules about that?
 


Edited by DBlank - 20 Nov 2013 at 8:53am
IP IP Logged
MarkW
Newbie
Newbie
Avatar

Joined: 19 Nov 2013
Location: Canada
Online Status: Offline
Posts: 3
Quote MarkW Replybullet Posted: 20 Nov 2013 at 10:18am
Hi Thanks for the swift reply, your suggestion worked like a charm. I need to get more involved in crystal as doing the odd report now and again leaves me getting little experience.

I need two reports, one which covers the first half of the month in question, and a second report which gives data for the remainder of the month.

I can set the dates and then save the report with a different name and have them run automatically using EasyView
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Nov 2013 at 10:22am
so if your run date month day is>15  use the current month days of 1-15 and if it is <16 use th prior month dat afrom day 16 to the end of the month?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Nov 2013 at 11:17am
(
datepart('d',currentdate)>15 and {SORMASTER.ReqShipDate} in Monthtodate and datepart('d',{SORMASTER.ReqShipDate})<16
or
datepart('d',currentdate)<16 and {SORMASTER.ReqShipDate} in lastfullmonth and datepart('d',{SORMASTER.ReqShipDate})>15
)
and {SORMASTER.OrderStatus} = "9"
IP IP Logged
MarkW
Newbie
Newbie
Avatar

Joined: 19 Nov 2013
Location: Canada
Online Status: Offline
Posts: 3
Quote MarkW Replybullet Posted: 21 Nov 2013 at 11:41am
Hi, The reports run as expected after your excellent help.

I really appreciate it,

Mark.
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