The document contains two SQL queries that retrieve data from the 'tblFabricOutwardGPHead' and 'tblPartyDetails' tables. The first query selects various fields including party name, job number, and weights for specific dates, while the second query aggregates the weights by party name for the same date range. Both queries utilize an inner join and filter results based on a specific date condition.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
18 views1 page
Dispatch Report
The document contains two SQL queries that retrieve data from the 'tblFabricOutwardGPHead' and 'tblPartyDetails' tables. The first query selects various fields including party name, job number, and weights for specific dates, while the second query aggregates the weights by party name for the same date range. Both queries utilize an inner join and filter results based on a specific date condition.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
SELECT
tblPartyDetails.partyname AS 'Party Name'
,tblFabricOutwardGPHead.fogphJobNo AS 'Job No' ,tblFabricOutwardGPHead.fogphtecrukg AS 'ecruKG' ,tblFabricOutwardGPHead.fogphtnetkg AS 'netKG' ,tblFabricOutwardGPHead.fogphtgrosskg AS 'grossKG' ,tblFabricOutwardGPHead.fogphtecrumtr AS 'ecruMTR' ,tblFabricOutwardGPHead.fogphtnetmtr AS 'netMTR'
FROM tblFabricOutwardGPHead
INNER JOIN tblPartyDetails ON tblPartyDetails.id =
tblFabricOutwardGPHead.ref_partynameid WHERE (CONVERT(VARCHAR, tblFabricOutwardGPHead.fogphcdate, 112) BETWEEN '20250101 00:00:00' AND '20250114 23:59:59')
--,tblFabricOutwardGPHead.fogphJobNo AS 'Job No' ,SUM(CAST(tblFabricOutwardGPHead.fogphtecrukg AS DECIMAL(10, 2))) AS 'EcruKG' ,SUM(CAST(tblFabricOutwardGPHead.fogphtnetkg AS DECIMAL(10, 2))) AS 'netKG' --,SUM(CAST(tblFabricOutwardGPHead.fogphtgrosskg AS DECIMAL(10, 2))) AS 'grossKG' --,SUM(CAST(tblFabricOutwardGPHead.fogphtecrumtr AS DECIMAL(10, 2))) AS 'ecruMTR' ,SUM(CAST(tblFabricOutwardGPHead.fogphtnetmtr AS DECIMAL(10, 2))) AS 'netMTR'
FROM tblFabricOutwardGPHead
INNER JOIN tblPartyDetails ON tblPartyDetails.id =
tblFabricOutwardGPHead.ref_partynameid WHERE (CONVERT(VARCHAR, tblFabricOutwardGPHead.fogphcdate, 112) BETWEEN '20250101 00:00:00' AND '20250114 23:59:59') GROUP BY tblPartyDetails.partyname