Hello to everyone i have a databse made up of 5 table, where 4 of the tables are linked to the fifth one by foreign keys.
the tables are as follows.
- Client - ClientID, ClientName
- Brand - BrandID, BrandName
- Currency - CurrencyID, CurrencyType
- RegisterShipments - RegShipmentID, ShipmentNo, ConsignmentNo,BDM,HUDINT,PAN
The following table has the above tables linked to it using Foreign Keys:
5. RegisterShipmentNoDetails - ShipmentDetailsID (PK), RegShipmentID(FK),CLinetID(FK),BrandID(FK),CurrencyID(FK), Season
What i would like to do is to be able to retrieve the data depending on shipment number chosen by user, as well as all the data of all the shipments that are present from the corresponding tables and display it in a datagrid.
I have come up with the following Select Statement, but it seem that it is not working as when i run the query in SQL it is giving me an error that Invalid object name 'RegisterShipmentNoDetails'. .
SELECT Client.*,Brand.*, RegisterShipments.*, Currency.* from RegisterShipmentNoDetails
inner join RegisterShipments on RegisterShipmentNoDetails.RegShipmentID = RegisterShipments.ShipmentNo
inner join Client on RegisterShipmentNoDetails.ClientID = Client.ClientName
inner join Brand on RegisterShipmentNoDetails.BrandID = Brand.BrandName
inner join Currency on RegisterShipmentNoDetails.CurrencyID = Currency.CurrencyType
Could someone please help me as i think that i might be doing something wrong in the select statement or else using the wrong Join. Thanks for any help.