Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Need Help with Crystal formulas Post Reply Post New Topic
Author Message
scommar1
Newbie
Newbie
Avatar

Joined: 10 Apr 2009
Location: United States
Online Status: Offline
Posts: 3
Quote scommar1 Replybullet Topic: Need Help with Crystal formulas
     Posted: 10 Apr 2009 at 10:05am
On a inventory Detail report  I needed to show 2 additional field-
1. When was the first date that the item was first sold- e.g I get the result with this query for a specific invtid.
select min(ShipDateAct)  from SOShipHeader where shipperid in
(select shipperid from SOShipLine where invtid = '9781591041542');

2. I am trying to see what the Itemhist2.YTDQtySls is for the year before
the year that I am running the report for. The YTDQTYSLS numbers are stored for each Year (Year is coloum FISCYR in table Itemhist2)
So if I am running the report for 2007 I want to see the Itemhist2.YTDQtySls numbers for the year before ie.2006

I would really appreciate any help with this


Thanks

Sam



Edited by scommar1 - 10 Apr 2009 at 10:06am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Apr 2009 at 11:44am
Can you use queries or stored procedures?
#1. It would be pretty easy to get the min date value grouped on invtid and use that to show your data.
#2. are you using a parameter to select your date for running the report? is there only one row per YTDQtySls per year? If so use the year part of the date parameter-1 = YTDQTYSLS in your select statement.
IP IP Logged
scommar1
Newbie
Newbie
Avatar

Joined: 10 Apr 2009
Location: United States
Online Status: Offline
Posts: 3
Quote scommar1 Replybullet Posted: 10 Apr 2009 at 12:24pm
I can use either but i need your help my friend. I dont know how to.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Apr 2009 at 1:23pm
OK but this is a little difficult not seeing your data and structure. Here is a process to try but you may need to tweak it a bit...
Assumingyou are using SQL...For #1 create a new query. Pull in the invtid and ShipDateAct fields. Group on the invtid and set the ShipDateAct to min. Bring this in and join it to your table on the invtid
For #2 do you have a date paramater you are using to select yur data for the report?
If so, add a selction criteria for something like this:
datepart("yyyy",Itemhist2.YTDQtySls}) = datepart("yyyy",{?date parameter field})-1
This is a little tricky as I do not know how this table is joined into the other table. May cause some problems...
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