Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Combine two files into one Post Reply Post New Topic
<< Prev Page  of 3
Author Message
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 28 Jan 2011 at 11:07am
Hi,
 
Thanks!  I'm really confused on the SQL.  I tried entering it exactly as it's written and I got errors.
 
This is what I have now.   It took the table type o.k. that seems to be working.
 
 
Select 'P' as TABLETYPE, PART, PURCHASE_ORDER as ORDERNO, DATE_DUE_LINE as ORDERDATE,QTY_ORDER as QTY from V_PO_LINES
Union
Select 'W' as TABLETYPE,PART,JOB as OrderNumber,DATE_DUE as ORDERDATE,QTY_COMMITTED as QTY from V_JOB_COMMITMENTS
 
 
 
but when i try to select  the on-hand qty from V_INVENTORY_MSTR, it doesn't work.
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 31 Jan 2011 at 7:17am
You have to create the joins to V_Inventory_Master in order to select data from it. 
 
I think I see where the error is in what I posted  - Change these lines at the end of the SQL:
 
from V_JOB_COMMITMENTS
  inner join V_INVENTORY_MSTR as inv on po.PART = inv.PART
to this:
 
from V_JOB_COMMITMENTS as jc
  inner join V_INVENTORY_MSTR as inv on jc.PART = inv.PART
-Dell
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 01 Feb 2011 at 2:59am

I am so CLOSE now to what I want.....I have the running total adding or subtracting as it should.  The only problem now I'm getting is on the first record I want the balance of on-hand +/- qty.    Right now this is what I'm getting:

Qty. On Hand   1,421

w/o or p.o.#                  Due Date           +/- Qty              Inventory Balance
 
008407                        3/28/2011            -100                -100
008410                        3/28/2011              -20                -120
008453                        3/28/2011              -10                -130
 
 
on the first line, inventory balance should be 1,321
on the second line, should be 1,301  ...etc....
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 01 Feb 2011 at 3:27am
You need to create a formula that takes your running total and adds it to the qty on hand number - since qty on hand is the same value for all records for a given part number, you don't have to do anything with that number.  Your formula will look something like this (using the name of the running total from my example):
 
{command.QTY_OnHand} - {#Inventory}
 
Use this formula on the report instead of just the running total.
 
-Dell
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 01 Feb 2011 at 10:03am
Bingo!  Got it !!!  LOL    Thank you so very much for all of your help.  Clap  I sincerely appreciate it, and sorry it took a while for things to "sink in" at times! 
IP IP Logged
<< Prev Page  of 3
Post Reply Post New Topic
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



This page was generated in 0.063 seconds.