Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Combining data from two tables Post Reply Post New Topic
Author Message
Guz_1001
Newbie
Newbie
Avatar

Joined: 27 Nov 2008
Location: Australia
Online Status: Offline
Posts: 1
Quote Guz_1001 Replybullet Topic: Combining data from two tables
    Posted: 27 Nov 2008 at 1:43am
Hi I am new to the board but have a query about how to perform the following problem.
I have a business system that stores in tables.
Current sales orders are stored in 'SalesOrders' and completed sales orders are stored in 'archivedSalesOrders'  The field names are the same but how do I complete a combined list of the following fields 'OrderNumber', OrderDate', "OrderCost','OrderTotal'.

I have spent hours trying to do this myself and hours searching for an answer but no luck, any help wouuld be appreciated.
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 27 Nov 2008 at 3:04am
Hi
 
'SalesOrders' archivedSalesOrders'
 
Above two tables will have a Sales Order ID or ID field which will have common values in both the tables what you need to do is join both the tables based on that field also you need alias names created for the tables as the column names are same from both the tables
 
So your sql will be
 
Select
'Sord.OrderNumber',
'Sord.OrderDate',
'Sord.OrderCost',
'Sord.OrderTotal'
From SalesOrder Sord
INNER JOIN  archivedSalesOrders ASord
WHERE Sord.id = ASord.id
 
I donn which tables the column names you want to use,above i have just used alias name from SalesOrder table Sord for sample,you will need to alias the column names as you want to get from the correct table.
 
Cheers
Rahul
IP IP Logged
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.016 seconds.