How do I go about finding what tables are being used in this report?
Thanks
Mel
How do I go about finding what tables are being used in this report?
Thanks
Mel
I would go to the report style and then jump to the related report data definition which should show the tables available to the report.
Not necessarily - sometimes the RDD generates a table of data which is not the same as the source ERP tables ⌠and i think this is one of those âŚ
but you can bet the farm PARTTRAN table is being used as the base
Attached is a dashboard I created to show POSTED Inventory/WIP transactions for both parts and labor for a given fiscal period. This was done in 10.1.400. It was originally developed in E9 so Iâm pretty sure the tables havenât changed. If nothing else, the BAQ will help you understand the table linkages.
Andy Cicala
Partner
[TGem_final]
Delivering Effective Business Solutions
Mobile: (973) 615-5033
www.trigemco.com
Acicala@trigemco.commailto:Acicala@trigemco.com
InvWIPReconDB.DBD (574 KB)
What format is this attachment in? It would be great if you could post the SQL or in a more universal format. I just need query logic and tables used
its a dashboardâŚbelow are the two baqâs in the dashboard
select
[TranGLC].[FiscalYear] as [TranGLC_FiscalYear],
[GLJrnDtl].[FiscalPeriod] as [GLJrnDtl_FiscalPeriod],
[TranGLC].[TranDate] as [TranGLC_TranDate],
[GLJrnDtl].[PostedDate] as [GLJrnDtl_PostedDate],
[GLAcctDisp].[GLAcctDisp] as [GLAcctDisp_GLAcctDisp],
[TranGLC].[BookDebitAmount] as [TranGLC_BookDebitAmount],
[TranGLC].[BookCreditAmount] as [TranGLC_BookCreditAmount],
(âLaborâ) as [Calculated_CalcTranType],
(LaborDtl_JobHead.ProjectID) as [Calculated_CalcProjectID],
[LaborDtl_JobHead].[Plant] as [LaborDtl_JobHead_Plant],
(âLaborâ) as [Calculated_CalcPartClass],
[LaborDtl].[CreatedBy] as [LaborDtl_CreatedBy],
[LaborDtl].[JobNum] as [LaborDtl_JobNum],
[LaborDtl].[EmployeeNum] as [LaborDtl_EmployeeNum],
[EmpBasic].[Name] as [EmpBasic_Name],
[LaborDtl].[Shift] as [LaborDtl_Shift],
[LaborDtl].[LaborQty] as [LaborDtl_LaborQty],
[LaborDtl].[ScrapQty] as [LaborDtl_ScrapQty],
[LaborDtl].[LaborHrs] as [LaborDtl_LaborHrs],
[LaborDtl].[BurdenHrs] as [LaborDtl_BurdenHrs],
[LaborDtl].[ScrapReasonCode] as [LaborDtl_ScrapReasonCode],
[LaborDtl].[IndirectCode] as [LaborDtl_IndirectCode],
[TranGLC].[SegValue1] as [TranGLC_SegValue1],
[TranGLC].[SegValue2] as [TranGLC_SegValue2],
[TranGLC].[SegValue3] as [TranGLC_SegValue3],
[TranGLC].[SegValue4] as [TranGLC_SegValue4],
[TranGLC].[JournalCode] as [TranGLC_JournalCode],
[TranGLC].[JournalNum] as [TranGLC_JournalNum],
[TranGLC].[JournalLine] as [TranGLC_JournalLine],
[GLJrnDtl].[SourceModule] as [GLJrnDtl_SourceModule],
[TranGLC].[Company] as [TranGLC_Company],
[TranGLC].[BookID] as [TranGLC_BookID],
[GLBook].[CurrencyCode] as [GLBook_CurrencyCode],
[GLJrnDtl].[PostedBy] as [GLJrnDtl_PostedBy],
[LaborDtl].[ClockInDate] as [LaborDtl_ClockInDate],
[LaborDtl].[CreateDate] as [LaborDtl_CreateDate]
from Erp.TranGLC as TranGLC
inner join Erp.GLAcctDisp as GLAcctDisp on
TranGLC.Company = GLAcctDisp.Company
and TranGLC.COACode = GLAcctDisp.COACode
and TranGLC.GLAccount = GLAcctDisp.GLAccount
inner join Erp.GLJrnDtl as GLJrnDtl on
TranGLC.Company = GLJrnDtl.Company
and TranGLC.FiscalYear = GLJrnDtl.FiscalYear
and TranGLC.JournalNum = GLJrnDtl.JournalNum
and TranGLC.JournalLine = GLJrnDtl.JournalLine
and TranGLC.JournalCode = GLJrnDtl.JournalCode
and TranGLC.BookID = GLJrnDtl.BookID
inner join Erp.GLBook as GLBook on
TranGLC.Company = GLBook.Company
and TranGLC.BookID = GLBook.BookID
left outer join Erp.LaborDtl as LaborDtl on
TranGLC.Company = LaborDtl.Company
and TranGLC.Key1 = Convert(nvarchar,LaborDtl.LaborHedSeq)
and TranGLC.Key2 = Convert(nvarchar,LaborDtl.LaborDtlSeq)
left outer join Erp.JobHead as LaborDtl_JobHead on
LaborDtl.Company = LaborDtl_JobHead.Company
and LaborDtl.JobNum = LaborDtl_JobHead.JobNum
inner join Erp.EmpBasic as EmpBasic on
LaborDtl.Company = EmpBasic.Company
and LaborDtl.EmployeeNum = EmpBasic.EmpID
where (TranGLC.JournalCode = âIJâ and TranGLC.RelatedToFile = âLaborDtlâ)
select
[TranGLC].[FiscalYear] as [TranGLC_FiscalYear],
[GLJrnDtl].[FiscalPeriod] as [GLJrnDtl_FiscalPeriod],
[TranGLC].[TranDate] as [TranGLC_TranDate],
[GLJrnDtl].[PostedDate] as [GLJrnDtl_PostedDate],
[GLAcctDisp].[GLAcctDisp] as [GLAcctDisp_GLAcctDisp],
[TranGLC].[BookDebitAmount] as [TranGLC_BookDebitAmount],
[TranGLC].[BookCreditAmount] as [TranGLC_BookCreditAmount],
[PartTran].[TranType] as [PartTran_TranType],
(case
when JobHead.ProjectID > ââ then JobHead.ProjectID
when PORel.ProjectID > ââ then PORel.ProjectID
when OrderDtl.ProjectID > ââ then OrderDtl.ProjectID
when PORel.GloviaProjectID_c > ââ then PORel.GloviaProjectID_c
else ââ
end) as [Calculated_CalcProject],
[PartTran].[Plant] as [PartTran_Plant],
((case when PartClass.Description <> ââ then PartClass.Description else PartTran_PartClass.Description end)) as [Calculated_CalcPartClass],
[PartTran].[EntryPerson] as [PartTran_EntryPerson],
[PartTran].[PartNum] as [PartTran_PartNum],
[PartTran].[PartDescription] as [PartTran_PartDescription],
[PartTran].[TranQty] as [PartTran_TranQty],
[PartTran].[DimCode] as [PartTran_DimCode],
[Vendor].[Name] as [Vendor_Name],
[PartTran].[PONum] as [PartTran_PONum],
[PartTran].[PackSlip] as [PartTran_PackSlip],
[PartTran].[PackNum] as [PartTran_PackNum],
[PartTran].[InvAdjReason] as [PartTran_InvAdjReason],
[PartTran].[InvoiceNum] as [PartTran_InvoiceNum],
[PartTran].[JobNum] as [PartTran_JobNum],
[TranGLC].[SegValue1] as [TranGLC_SegValue1],
[TranGLC].[SegValue2] as [TranGLC_SegValue2],
[TranGLC].[SegValue3] as [TranGLC_SegValue3],
[TranGLC].[SegValue4] as [TranGLC_SegValue4],
[TranGLC].[JournalCode] as [TranGLC_JournalCode],
[TranGLC].[JournalNum] as [TranGLC_JournalNum],
[TranGLC].[JournalLine] as [TranGLC_JournalLine],
[GLJrnDtl].[SourceModule] as [GLJrnDtl_SourceModule],
[TranGLC].[Company] as [TranGLC_Company],
[TranGLC].[BookID] as [TranGLC_BookID],
[GLBook].[CurrencyCode] as [GLBook_CurrencyCode],
[GLJrnDtl].[PostedBy] as [GLJrnDtl_PostedBy],
[PartTran].[SysDate] as [PartTran_SysDate],
[PartTran].[TranDate] as [PartTran_TranDate]
from Erp.TranGLC as TranGLC
inner join Erp.GLAcctDisp as GLAcctDisp on
TranGLC.Company = GLAcctDisp.Company
and TranGLC.COACode = GLAcctDisp.COACode
and TranGLC.GLAccount = GLAcctDisp.GLAccount
inner join Erp.GLJrnDtl as GLJrnDtl on
TranGLC.Company = GLJrnDtl.Company
and TranGLC.FiscalYear = GLJrnDtl.FiscalYear
and TranGLC.JournalNum = GLJrnDtl.JournalNum
and TranGLC.JournalLine = GLJrnDtl.JournalLine
and TranGLC.JournalCode = GLJrnDtl.JournalCode
and TranGLC.BookID = GLJrnDtl.BookID
inner join Erp.GLBook as GLBook on
TranGLC.Company = GLBook.Company
and TranGLC.BookID = GLBook.BookID
left outer join Erp.PartTran as PartTran on
TranGLC.Company = PartTran.Company
and TranGLC.Key3 = PartTran.TranNum
and ( PartTran.PartNum = â11051â )
left outer join Erp.JobHead as JobHead on
PartTran.Company = JobHead.Company
and PartTran.JobNum = JobHead.JobNum
left outer join Erp.PODetail as PODetail on
PartTran.Company = PODetail.Company
and PartTran.PONum = PODetail.PONUM
and PartTran.POLine = PODetail.POLine
left outer join Erp.PartClass as PartClass on
PODetail.Company = PartClass.Company
and PODetail.ClassID = PartClass.ClassID
left outer join Erp.Vendor as Vendor on
PartTran.Company = Vendor.Company
and PartTran.VendorNum = Vendor.VendorNum
left outer join Erp.PORel as PORel on
PartTran.Company = PORel.Company
and PartTran.PONum = PORel.PONum
and PartTran.POLine = PORel.POLine
and PartTran.PORelNum = PORel.PORelNum
left outer join Erp.OrderDtl as OrderDtl on
PartTran.Company = OrderDtl.Company
and PartTran.OrderNum = OrderDtl.OrderNum
and PartTran.OrderLine = OrderDtl.OrderLine
left outer join Erp.Part as Part on
PartTran.Company = Part.Company
and PartTran.PartNum = Part.PartNum
left outer join Erp.PartClass as PartTran_PartClass on
Part.Company = PartTran_PartClass.Company
and Part.ClassID = PartTran_PartClass.ClassID
where (TranGLC.JournalCode = âIJâ and TranGLC.RelatedToFile = âPartTranâ)
Thanks Paul, I suppose one thing that is a bit confusing with the query you shared is that it does not come out the same as the crystal report. When I ran a DB trace I found a number of queries, but not sure how to bridge the data queried to the report format seen
Trace:
declare
@P1 varchar(8)=âCCâ,
@P2 varchar(12)=âMAINâ,
@P3 datetime2=â2021-07-02 00:00:00â,
@P4 datetime2=â2021-07-30 00:00:00â,
@P5 varchar(30)=âLabor Detailâ,
@P6 varchar(32)=âLaborDtlâ
SELECT âCompanyâ, âRelatedToFileâ, âKey1â, âKey2â, âKey3â, âKey4â, âKey5â, âKey6â, âTGLCTranNumâ,
âGLAcctContextâ, âBookIDâ, âCOACodeâ, âGLAccountâ, âUserCanModifyâ, âSegValue1â, âSegValue2â, âSegValue3â,
âSegValue4â, âSegValue5â, âSegValue6â, âSegValue7â, âSegValue8â, âSegValue9â, âSegValue10â, âSegValue11â,
âSegValue12â, âSegValue13â, âSegValue14â, âSegValue15â, âSegValue16â, âSegValue17â, âSegValue18â, âSegValue19â,
âSegValue20â, âSysGLControlTypeâ, âSysGLControlCodeâ, âExtCompanyIDâ, âIsExternalCompanyâ, âSysRowIDâ, âSysRevIDâ,
âFiscalYearâ, âJournalCodeâ, âJournalNumâ, âJournalLineâ, âTranDateâ, âTranSourceâ, âLaborHedSeqâ, âLaborDtlSeqâ,
âSysDate_â, âSysTimeâ, âTranNumâ, âARInvoiceNumâ, âTransAmtâ, âInvoiceLineâ, âSeqNumâ, âVendorNumâ, âAPInvoiceNumâ,
âCreateDateâ, âFiscalYearSuffixâ, âFiscalCalendarIDâ, âCreditAmountâ, âDebitAmountâ, âBookCreditAmountâ,
âBookDebitAmountâ, âCurrencyCodeâ, âRecordTypeâ, âBitFlagâ, âCorrAccUIDâ, âABTUIDâ, âRuleUIDâ, âStatisticalâ,
âStatUOMCodeâ, âDebitStatAmtâ, âCreditStatAmtâ, PROGRESS_RECID, PROGRESS_RECID_IDENT_ FROM âdboâ.âTranGLCâ
WHERE ((âCompanyâ = @P1) AND (âBookIDâ = @P2) AND (âTranDateâ >= @P3) AND (âTranDateâ < DATEADD(DAY,1, @P4))
AND (âSysGLControlTypeâ = @P5) AND (âRelatedToFileâ = @P6))
ORDER BY âCompanyâ, âRelatedToFileâ, âKey1â, âKey2â, âKey3â, âKey4â, âKey5â, âKey6â, âTGLCTranNumâ
â,âCCâ,âMAINâ,â2021-07-02 00:00:00â,â2021-07-30 00:00:00â,âLabor Detailâ,âLaborDtlâ
Declare
@P1 varchar(8)=âCCâ,
@P2 varchar(12)=âMAINâ,
@P3 datetime2=â2021-07-02 00:00:00â,
@P4 datetime2=â2021-07-30 00:00:00â,
@P5 varchar(32)=âPartTranâ
SELECT âCompanyâ, âRelatedToFileâ, âKey1â, âKey2â, âKey3â, âKey4â, âKey5â, âKey6â, âTGLCTranNumâ, âGLAcctContextâ,
âBookIDâ, âCOACodeâ, âGLAccountâ, âUserCanModifyâ, âSegValue1â, âSegValue2â, âSegValue3â, âSegValue4â, âSegValue5â,
âSegValue6â, âSegValue7â, âSegValue8â, âSegValue9â, âSegValue10â, âSegValue11â, âSegValue12â, âSegValue13â,
âSegValue14â, âSegValue15â, âSegValue16â, âSegValue17â, âSegValue18â, âSegValue19â, âSegValue20â,
âSysGLControlTypeâ, âSysGLControlCodeâ, âExtCompanyIDâ, âIsExternalCompanyâ, âSysRowIDâ, âSysRevIDâ,
âFiscalYearâ, âJournalCodeâ, âJournalNumâ, âJournalLineâ, âTranDateâ, âTranSourceâ, âLaborHedSeqâ,
âLaborDtlSeqâ, âSysDate_â, âSysTimeâ, âTranNumâ, âARInvoiceNumâ, âTransAmtâ, âInvoiceLineâ, âSeqNumâ,
âVendorNumâ, âAPInvoiceNumâ, âCreateDateâ, âFiscalYearSuffixâ, âFiscalCalendarIDâ, âCreditAmountâ,
âDebitAmountâ, âBookCreditAmountâ, âBookDebitAmountâ, âCurrencyCodeâ, âRecordTypeâ, âBitFlagâ,
âCorrAccUIDâ, âABTUIDâ, âRuleUIDâ, âStatisticalâ, âStatUOMCodeâ, âDebitStatAmtâ, âCreditStatAmtâ,
PROGRESS_RECID, PROGRESS_RECID_IDENT_ FROM âdboâ.âTranGLCâ
WHERE ((âCompanyâ = @P1) AND (âBookIDâ = @P2) AND (âTranDateâ >= @P3) AND (âTranDateâ < DATEADD(DAY,1, @P4))
AND (âRelatedToFileâ = @P5))
ORDER BY âCompanyâ, âRelatedToFileâ, âKey1â, âKey2â, âKey3â, âKey4â, âKey5â, âKey6â, âTGLCTranNumâ
â,âCCâ,âMAINâ,â2021-07-02 00:00:00â,â2021-07-30 00:00:00â,âPartTranâ
Declare
@P1 varchar(8)=âCCâ,
@P2 datetime2=â2021-07-02 00:00:00â,
@P3 datetime2=â2021-07-02 00:00:00â,
@P4 varchar(7)=âMFG-VENâ,
@P5 tinyint=1,
@P6 tinyint=0
SELECT âCompanyâ, âSysDate_â, âSysTimeâ, âTranNumâ, âPartNumâ, âWareHouseCodeâ, âBinNumâ,
âTranClassâ, âTranTypeâ, âInventoryTransâ, âTranDateâ, âTranQtyâ, âUMâ, âMtlUnitCostâ, âLbrUnitCostâ,
âBurUnitCostâ, âSubUnitCostâ, âMtlBurUnitCostâ, âExtCostâ, âCostMethodâ, âJobNumâ, âAssemblySeqâ,
âJobSeqTypeâ, âJobSeqâ, âPackTypeâ, âPackNumâ, âPackLineâ, âPONumâ, âPOLineâ, âPORelNumâ, âWareHouse2â,
âBinNum2â, âOrderNumâ, âOrderLineâ, âOrderRelNumâ, âEntryPersonâ, âTranReferenceâ, âPartDescriptionâ,
âRevisionNumâ, âVendorNumâ, âPurPointâ, âPOReceiptQtyâ, âPOUnitCostâ, âPackSlipâ, âInvoiceNumâ,
âInvoiceLineâ, âInvAdjSrcâ, âInvAdjReasonâ, âLotNumâ, âDimCodeâ, âDUMâ, âDimConvFactorâ, âLotNum2â,
âDimCode2â, âDUM2â, âDimConvFactor2â, âGLTransâ, âPostedToGLâ, âFiscalYearâ, âFiscalPeriodâ, âJournalNumâ,
âCostedâ, âDMRNumâ, âActionNumâ, âRMANumâ, âCOSPostingReqdâ, âJournalCodeâ, âPlantâ, âPlant2â, âCallNumâ,
âCallLineâ, âMatNumâ, âJobNum2â, âAssemblySeq2â, âJobSeq2â, âCustNumâ, âRMALineâ, âRMAReceiptâ, âRMADispâ,
âOtherDivValueâ, âPlantTranNumâ, âNonConfIDâ, âMtlMtlUnitCostâ, âMtlLabUnitCostâ, âMtlSubUnitCostâ,
âMtlBurdenUnitCostâ, âRefTypeâ, âRefCodeâ, âLegalNumberâ, âBeginQtyâ, âAfterQtyâ, âBegBurUnitCostâ,
âBegLbrUnitCostâ, âBegMtlBurUnitCostâ, âBegMtlUnitCostâ, âBegSubUnitCostâ, âAfterBurUnitCostâ,
âAfterLbrUnitCostâ, âAfterMtlBurUnitCostâ, âAfterMtlUnitCostâ, âAfterSubUnitCostâ, âPlantCostValueâ,
âCharacter01â, âCharacter02â, âCharacter03â, âCharacter04â, âCharacter05â, âCharacter06â, âCharacter07â,
âCharacter08â, âCharacter09â, âCharacter10â, âNumber01â, âNumber02â, âNumber03â, âNumber04â, âNumber05â,
âNumber06â, âNumber07â, âNumber08â, âNumber09â, âNumber10â, âDate01â, âDate02â, âDate03â, âDate04â,
âDate05â, âCheckBox01â, âCheckBox02â, âCheckBox03â, âCheckBox04â, âCheckBox05â, âEmpIDâ, âReconcileNumâ,
âCostIDâ, âFIFODateâ, âFIFOSeqâ, âActTranQtyâ, âActTransUOMâ, âInvtyUOMâ, âInvtyUOM2â, âFIFOActionâ,
âFiscalYearSuffixâ, âFiscalCalendarIDâ, âSysRowIDâ, âSysRevIDâ, âBinTypeâ, âCCYearâ, âCCMonthâ, âCycleSeqâ,
âABTUIDâ, âBaseCostMethodâ, âRevertStatusâ, âRevertIDâ, âDropShipPackSlipâ, âBitFlagâ, âVarTargetâ,
âFIFOSubSeqâ, âAltMtlUnitCostâ, âAltLbrUnitCostâ, âAltBurUnitCostâ, âAltSubUnitCostâ, âAltMtlBurUnitCostâ,
âAltExtCostâ, âAltMtlMtlUnitCostâ, âAltMtlLabUnitCostâ, âAltMtlSubUnitCostâ, âAltMtlBurdenUnitCostâ,
âTranDocTypeIDâ, âPBInvNumâ, âLoanFlagâ, âAssetNumâ, âAdditionNumâ, âDisposalNumâ, âProjProcessedâ,
âAsOfDateâ, âAsOfSeqâ, âMscNumâ, PROGRESS_RECID, PROGRESS_RECID_IDENT_ FROM âdboâ.âPartTranâ
WHERE ((âCompanyâ = @P1) AND (âTranDateâ >= @P2 AND âTranDateâ < DATEADD(DAY,1, @P3)) AND (âTranTypeâ <> @P4)
AND (âGLTransâ = @P5) AND (âPostedToGLâ = @P6))
ORDER BY âCompanyâ, âTranDateâ, PROGRESS_RECID
â,âCCâ,â2021-07-02 00:00:00â,â2021-07-02 00:00:00â,âMFG-VENâ,1,0
Declare
@P1 varchar(8)=âCCâ,
@P2 datetime2=â2021-07-02 00:00:00â,
@P3 datetime2=â2021-07-02 00:00:00â,
@P4 tinyint=0,
@P5 tinyint=0
SELECT
âCompanyâ, âEmployeeNumâ, âLaborHedSeqâ, âLaborDtlSeqâ, âLaborTypeâ, âLaborTypePseudoâ, âReWorkâ,
âReworkReasonCodeâ, âJobNumâ, âAssemblySeqâ, âOprSeqâ, âJCDeptâ, âResourceGrpIDâ, âOpCodeâ, âLaborHrsâ,
âBurdenHrsâ, âLaborQtyâ, âScrapQtyâ, âScrapReasonCodeâ, âSetupPctCompleteâ, âCompleteâ, âIndirectCodeâ,
âLaborNoteâ, âExpenseCodeâ, âLaborCollectionâ, âAppliedToScheduleâ, âClockInMInuteâ, âClockOutMinuteâ,
âClockInDateâ, âClockinTimeâ, âClockOutTimeâ, âActiveTransâ, âOverRidePayRateâ, âLaborRateâ, âBurdenRateâ,
âDspClockInTimeâ, âDspClockOutTimeâ, âResourceIDâ, âOpCompleteâ, âEarnedHrsâ, âAddedOperâ, âPayrollDateâ,
âPostedToGLâ, âFiscalYearâ, âFiscalPeriodâ, âJournalNumâ, âGLTransâ, âJournalCodeâ, âInspectionPendingâ,
âCallNumâ, âCallLineâ, âServNumâ, âServCodeâ, âResReasonCodeâ, âWipPostedâ, âDiscrepQtyâ, âDiscrpRsnCodeâ,
âParentLaborDtlSeqâ, âLaborEntryMethodâ, âObsolete905_ServiceTechEntryâ, âCharacter01â, âCharacter02â,
âCharacter03â, âCharacter04â, âCharacter05â, âCharacter06â, âCharacter07â, âCharacter08â, âCharacter09â,
âCharacter10â, âNumber01â, âNumber02â, âNumber03â, âNumber04â, âNumber05â, âNumber06â, âNumber07â, âNumber08â,
âNumber09â, âNumber10â, âDate01â, âDate02â, âDate03â, âDate04â, âDate05â, âCheckBox01â, âCheckBox02â, âCheckBox03â,
âCheckBox04â, âCheckBox05â, âNumber11â, âNumber12â, âNumber13â, âNumber14â, âNumber15â, âNumber16â, âNumber17â,
âNumber18â, âNumber19â, âNumber20â, âDate06â, âDate07â, âDate08â, âDate09â, âDate10â, âDate11â, âDate12â, âDate13â,
âDate14â, âDate15â, âDate16â, âDate17â, âDate18â, âDate19â, âDate20â, âCheckBox06â, âCheckBox07â, âCheckBox08â,
âCheckBox09â, âCheckBox10â, âCheckBox11â, âCheckBox12â, âCheckBox13â, âCheckBox14â, âCheckBox15â, âCheckBox16â,
âCheckBox17â, âCheckBox18â, âCheckBox19â, âCheckBox20â, âShortChar01â, âShortChar02â, âShortChar03â, âShortChar04â,
âShortChar05â, âShortChar06â, âShortChar07â, âShortChar08â, âShortChar09â, âShortChar10â, âFiscalYearSuffixâ,
âFiscalCalendarIDâ, âSysRowIDâ, âSysRevIDâ, âBFLaborReqâ, âBitFlagâ, âABTUIDâ, âProjectIDâ, âPhaseIDâ, âRoleCdâ,
âTimeTypCdâ, âPBInvNumâ, âPMUIDâ, âTaskSetIDâ, âApprovedDateâ, âClaimRefâ, âQuickEntryCodeâ, âTimeStatusâ,
âCreatedByâ, âCreateDateâ, âCreateTimeâ, âChangedByâ, âChangeDateâ, âChangeTimeâ, âActiveTaskIDâ, âLastTaskIDâ,
âCreatedViaTEWeekViewâ, âCurrentWFStageIDâ, âWFGroupIDâ, âWFCompleteâ, âApprovalRequiredâ, âSubmittedByâ,
âPBRateFromâ, âPBCurrencyCodeâ, âPBHoursâ, âPBChargeRateâ, âPBChargeAmtâ, âDocPBChargeRateâ, âRpt1PBChargeRateâ,
âRpt2PBChargeRateâ, âRpt3PBChargeRateâ, âDocPBChargeAmtâ, âRpt1PBChargeAmtâ, âRpt2PBChargeAmtâ, âRpt3PBChargeAmtâ,
âShiftâ, âActIDâ, âDtailIDâ, âProjProcessedâ, âAsOfDateâ, âAsOfSeqâ, PROGRESS_RECID, PROGRESS_RECID_IDENT_
FROM âdboâ.âLaborDtlâ WHERE ((âCompanyâ = @P1)
AND (âPayrollDateâ >= @P2 AND âPayrollDateâ < DATEADD(DAY,1, @P3))
AND (âPostedToGLâ = @P4) AND (âActiveTransâ = @P5))
ORDER BY âCompanyâ, âPayrollDateâ, âPostedToGLâ, âActiveTransâ, PROGRESS_RECID
ââCCâ,â2021-07-02 00:00:00â,â2021-07-02 00:00:00â,0,0
declare
@P1 varchar(8)=âCCâ,
@P2 tinyint=1,
@P3 tinyint=0,
@P4 varchar(8)=âCCâ,
@P5 datetime2=â2021-07-02 00:00:00â,
@P6 datetime2=â2021-07-02 00:00:00â,
@P7 tinyint=1
SELECT T0.âCompanyâ, T0.âInvoiceNumâ, T0.âInvoiceLineâ, T0.âLineTypeâ, T0.âContractNumâ, T0.âXPartNumâ,
T0.âXRevisionNumâ, T0.âPartNumâ, T0.âLineDescâ, T0.âIUMâ, T0.âRevisionNumâ, T0.âPOLineâ, T0.âTaxExemptâ,
T0.âTaxCatIDâ, T0.âCommissionableâ, T0.âDiscountPercentâ, T0.âUnitPriceâ, T0.âDocUnitPriceâ, T0.âPricePerCodeâ,
T0.âOurOrderQtyâ, T0.âExtPriceâ, T0.âDocExtPriceâ, T0.âDiscountâ, T0.âDocDiscountâ, T0.âTotalMiscChrgâ,
T0.âDocTotalMiscChrgâ, T0.âProdCodeâ, T0.âOurShipQtyâ, T0.âPackNumâ, T0.âPackLineâ, T0.âOrderNumâ,
T0.âOrderLineâ, T0.âOrderRelNumâ, T0.âShipToCustNumâ, T0.âShipToNumâ, T0.âShipDateâ, T0.âShipViaCodeâ,
T0.âAdvanceBillCreditâ, T0.âDocAdvanceBillCreditâ, T0.âCustNumâ, T0.âInvoiceCommentâ, T0.âShpConNumâ,
T0.âMtlUnitCostâ, T0.âLbrUnitCostâ, T0.âBurUnitCostâ, T0.âSubUnitCostâ, T0.âMtlBurUnitCostâ, T0.âCOSPostingReqdâ,
T0.âCOSPostedâ, T0.âCharacter01â, T0.âCharacter02â, T0.âCharacter03â, T0.âCharacter04â, T0.âCharacter05â,
T0.âCharacter06â, T0.âCharacter07â, T0.âCharacter08â, T0.âCharacter09â, T0.âCharacter10â, T0.âNumber01â,
T0.âNumber02â, T0.âNumber03â, T0.âNumber04â, T0.âNumber05â, T0.âNumber06â, T0.âNumber07â, T0.âNumber08â,
T0.âNumber09â, T0.âNumber10â, T0.âDate01â, T0.âDate02â, T0.âDate03â, T0.âDate04â, T0.âDate05â,
T0.âCheckBox01â, T0.âCheckBox02â, T0.âCheckBox03â, T0.âCheckBox04â, T0.âCheckBox05â, T0.âContractCodeâ,
T0.âCallNumâ, T0.âCallCodeâ, T0.âRMANumâ, T0.âRMALineâ, T0.âSalesCatIDâ, T0.âFiscalYearâ, T0.âFiscalPeriodâ,
T0.âJournalCodeâ, T0.âJournalNumâ, T0.âSellingOrderQtyâ, T0.âSellingShipQtyâ, T0.âSalesUMâ, T0.âSellingFactorâ,
T0.âProjectIDâ, T0.âMilestoneIDâ, T0.âListPriceâ, T0.âDocListPriceâ, T0.âOrdBasedPriceâ, T0.âDocOrdBasedPriceâ,
T0.âNumber11â, T0.âNumber12â, T0.âNumber13â, T0.âNumber14â, T0.âNumber15â, T0.âNumber16â, T0.âNumber17â,
T0.âNumber18â, T0.âNumber19â, T0.âNumber20â, T0.âDate06â, T0.âDate07â, T0.âDate08â, T0.âDate09â, T0.âDate10â,
T0.âDate11â, T0.âDate12â, T0.âDate13â, T0.âDate14â, T0.âDate15â, T0.âDate16â, T0.âDate17â, T0.âDate18â,
T0.âDate19â, T0.âDate20â, T0.âCheckBox06â, T0.âCheckBox07â, T0.âCheckBox08â, T0.âCheckBox09â, T0.âCheckBox10â,
T0.âCheckBox11â, T0.âCheckBox12â, T0.âCheckBox13â, T0.âCheckBox14â, T0.âCheckBox15â, T0.âCheckBox16â, T0.âCheckBox17â,
T0.âCheckBox18â, T0.âCheckBox19â, T0.âCheckBox20â, T0.âShortChar01â, T0.âShortChar02â, T0.âShortChar03â, T0.âShortChar04â,
T0.âShortChar05â, T0.âShortChar06â, T0.âShortChar07â, T0.âShortChar08â, T0.âShortChar09â,
T0.âShortChar10â, T0.âAdvGainLossâ, T0.âSellingFactorDirectionâ, T0.âRepRate1â, T0.âRepRate2â,
T0.âRepRate3â, T0.âRepRate4â, T0.âRepRate5â, T0.âRepSplit1â, T0.âRepSplit2â, T0.âRepSplit3â,
T0.âRepSplit4â, T0.âRepSplit5â, T0.âBTCustNumâ, T0.âJCMtlUnitCostâ, T0.âJCLbrUnitCostâ,
T0.âJCBurUnitCostâ, T0.âJCSubUnitCostâ, T0.âJCMtlBurUnitCostâ, T0.âChangedByâ, T0.âChangeDateâ,
T0.âChangeTimeâ, T0.âRevChargeMethodâ, T0.âOverrideReverseChargeâ, T0.âRevChargeAppliedâ,
T0.âTaxConnectCalcâ, T0.âGetDfltTaxIdsâ, T0.âRpt1AdvanceBillCreditâ, T0.âRpt2AdvanceBillCreditâ,
T0.âRpt3AdvanceBillCreditâ, T0.âRpt1Discountâ, T0.âRpt2Discountâ, T0.âRpt3Discountâ, T0.âRpt1ExtPriceâ,
T0.âRpt2ExtPriceâ, T0.âRpt3ExtPriceâ, T0.âRpt1ListPriceâ, T0.âRpt2ListPriceâ, T0.âRpt3ListPriceâ,
T0.âRpt1OrdBasedPriceâ, T0.âRpt2OrdBasedPriceâ, T0.âRpt3OrdBasedPriceâ, T0.âRpt1TotalMiscChrgâ,
T0.âRpt2TotalMiscChrgâ, T0.âRpt3TotalMiscChrgâ, T0.âRpt1UnitPriceâ, T0.âRpt2UnitPriceâ,
T0.âRpt3UnitPriceâ, T0.âRpt1AdvGainLossâ, T0.âRpt2AdvGainLossâ, T0.âRpt3AdvGainLossâ,
T0.âFiscalYearSuffixâ, T0.âFiscalCalendarIDâ, T0.âSysRowIDâ, T0.âSysRevIDâ, T0.âTaxRegionCodeâ,
T0.âUseOTSâ, T0.âOTSNameâ, T0.âOTSAddress1â, T0.âOTSAddress2â, T0.âOTSAddress3â, T0.âOTSCityâ,
T0.âOTSStateâ, T0.âOTSZIPâ, T0.âOTSResaleIDâ, T0.âOTSTaxRegionCodeâ, T0.âOTSContactâ, T0.âOTSFaxNumâ,
T0.âOTSPhoneNumâ, T0.âOTSCountryNumâ, T0.âPlantâ, T0.âWarehouseCodeâ, T0.âCallLineâ,
T0.âDropShipPackLineâ, T0.âDropShipPackSlipâ, T0.âBitFlagâ, T0.âFinChargeCodeâ, T0.âABTUIDâ,
T0.âInUnitPriceâ, T0.âDocInUnitPriceâ, T0.âInExtPriceâ, T0.âDocInExtPriceâ, T0.âInDiscountâ,
T0.âDocInDiscountâ, T0.âInTotalMiscChrgâ, T0.âDocInTotalMiscChrgâ, T0.âInListPriceâ, T0.âDocInListPriceâ,
T0.âInOrdBasedPriceâ, T0.âDocInOrdBasedPriceâ, T0.âRpt1InDiscountâ, T0.âRpt2InDiscountâ,
T0.âRpt3InDiscountâ, T0.âRpt1InExtPriceâ, T0.âRpt2InExtPriceâ, T0.âRpt3InExtPriceâ, T0.âRpt1InListPriceâ,
T0.âRpt2InListPriceâ, T0.âRpt3InListPriceâ, T0.âRpt1InOrdBasedPriceâ, T0.âRpt2InOrdBasedPriceâ,
T0.âRpt3InOrdBasedPriceâ, T0.âRpt1InTotalMiscChrgâ, T0.âRpt2InTotalMiscChrgâ, T0.âRpt3InTotalMiscChrgâ,
T0.âRpt1InUnitPriceâ, T0.âRpt2InUnitPriceâ, T0.âRpt3InUnitPriceâ, T0.âCorrectionDtlâ, T0.âAssetNumâ,
T0.âDisposalNumâ, T0.âIncomeTaxCodeâ, T0.âPBLineTypeâ, T0.âInvoiceLineRefâ, T0.âInvoiceRefâ, T0.âLotNumâ,
T0.âPBInvoiceLineâ, T0.âRAIDâ, T0.âRADtlIDâ, T0.âDeferredRevâ, T0.âRACodeâ, T0.âDefRevStartâ, T0.âChargeDefRevâ,
T0.âRenewalNbrâ, T0.PROGRESS_RECID, T0.PROGRESS_RECID_IDENT_, T1.âCompanyâ, T1.âOpenInvoiceâ, T1.âClosedDateâ,
T1.âCreditMemoâ, T1.âUnappliedCashâ, T1.âCheckRefâ, T1.âInvoiceSuffixâ, T1.âGroupIDâ, T1.âPostedâ,
T1.âInvoiceNumâ, T1.âInvoiceTypeâ, T1.âDeferredRevenueâ, T1.âOrderNumâ, T1.âCustNumâ, T1.âPONumâ,
T1.âEntryPersonâ, T1.âFOBâ, T1.âTermsCodeâ, T1.âInvoiceDateâ, T1.âDueDateâ, T1.âFiscalYearâ, T1.âFiscalPeriodâ,
T1.âGLPostedâ, T1.âInvoiceCommentâ, T1.âInvoiceAmtâ, T1.âDocInvoiceAmtâ, T1.âInvoiceBalâ, T1.âDocInvoiceBalâ,
T1.âUnpostedBalâ, T1.âDocUnpostedBalâ, T1.âDepositCreditâ, T1.âDocDepositCreditâ, T1.âSalesRepListâ, T1.âInvoiceRefâ,
T1.âRefCancelledâ, T1.âRefCancelledByâ, T1.âStartUpâ, T1.âPayDatesâ, T1.âPayAmountsâ, T1.âDocPayAmountsâ,
T1.âPayDiscDateâ, T1.âPayDiscAmtâ, T1.âDocPayDiscAmtâ, T1.âBillConNumâ, T1.âInvoiceHeldâ, T1.âCharacter01â,
T1.âCharacter02â, T1.âCharacter03â, T1.âCharacter04â, T1.âCharacter05â, T1.âCharacter06â, T1.âCharacter07â,
T1.âCharacter08â, T1.âCharacter09â, T1.âCharacter10â, T1.âNumber01â, T1.âNumber02â, T1.âNumber03â, T1.âNumber04â,
T1.âNumber05â, T1.âNumber06â, T1.âNumber07â, T1.âNumber08â, T1.âNumber09â, T1.âNumber10â, T1.âDate01â, T1.âDate02â,
T1.âDate03â, T1.âDate04â, T1.âDate05â, T1.âCheckBox01â, T1.âCheckBox02â, T1.âCheckBox03â, T1.âCheckBox04â,
T1.âCheckBox05â, T1.âCurrencyCodeâ, T1.âExchangeRateâ, T1.âLockRateâ, T1.âJournalNumâ, T1.âJournalCodeâ,
T1.âLineTypeâ, T1.âRMANumâ, T1.âPlantâ, T1.âCardMemberNameâ, T1.âCardNumberâ, T1.âCardTypeâ, T1.âExpirationMonthâ,
T1.âExpirationYearâ, T1.âCardIDâ, T1.âCardmemberReferenceâ, T1.âLegalNumberâ, T1.âExternalIDâ, T1.âXRefInvoiceNumâ,
T1.âNumber11â, T1.âNumber12â, T1.âNumber13â, T1.âNumber14â, T1.âNumber15â, T1.âNumber16â, T1.âNumber17â,
T1.âNumber18â, T1.âNumber19â, T1.âNumber20â, T1.âDate06â, T1.âDate07â, T1.âDate08â, T1.âDate09â,
T1.âDate10â, T1.âDate11â, T1.âDate12â, T1.âDate13â, T1.âDate14â, T1.âDate15â, T1.âDate16â, T1.âDate17â,
T1.âDate18â, T1.âDate19â, T1.âDate20â, T1.âCheckBox06â, T1.âCheckBox07â, T1.âCheckBox08â, T1.âCheckBox09â,
T1.âCheckBox10â, T1.âCheckBox11â, T1.âCheckBox12â, T1.âCheckBox13â, T1.âCheckBox14â, T1.âCheckBox15â,
T1.âCheckBox16â, T1.âCheckBox17â, T1.âCheckBox18â, T1.âCheckBox19â, T1.âCheckBox20â, T1.âShortChar01â,
T1.âShortChar02â, T1.âShortChar03â, T1.âShortChar04â, T1.âShortChar05â, T1.âShortChar06â,
T1.âShortChar07â, T1.âShortChar08â, T1.âShortChar09â, T1.âShortChar10â, T1.âDepGainLossâ, T1.âDNCommentsâ,
T1.âDNCustNbrâ, T1.âDebitNoteâ, T1.âSoldToCustNumâ, T1.âConsolidatedâ, T1.âBillToInvoiceAddressâ,
T1.âSoldToInvoiceAddressâ, T1.âProcessCardâ, T1.âRepComm1â, T1.âRepComm2â, T1.âRepComm3â, T1.âRepComm4â,
T1.âRepComm5â, T1.âRepRate1â, T1.âRepRate2â, T1.âRepRate3â, T1.âRepRate4â, T1.âRepRate5â, T1.âRepSales1â,
T1.âRepSales2â, T1.âRepSales3â, T1.âRepSales4â, T1.âRepSales5â, T1.âRepSplit1â, T1.âRepSplit2â,
T1.âRepSplit3â, T1.âRepSplit4â, T1.âRepSplit5â, T1.âCMTypeâ, T1.âCCStreetAddrâ, T1.âCCZipâ,
T1.âChangedByâ, T1.âChangeDateâ, T1.âChangeTimeâ, T1.âReadyToCalcâ, T1.âAutoPrintReadyâ, T1.âEDIReadyâ,
T1.âRecalcBeforePostâ, T1.âRoundingâ, T1.âDocRoundingâ, T1.âRpt1DepositCreditâ, T1.âRpt2DepositCreditâ,
T1.âRpt3DepositCreditâ, T1.âRpt1InvoiceAmtâ, T1.âRpt2InvoiceAmtâ, T1.âRpt3InvoiceAmtâ,
T1.âRpt1InvoiceBalâ, T1.âRpt2InvoiceBalâ, T1.âRpt3InvoiceBalâ, T1.âRpt1PayAmountsâ, T1.âRpt2PayAmountsâ,
T1.âRpt3PayAmountsâ, T1.âRpt1PayDiscAmtâ, T1.âRpt2PayDiscAmtâ, T1.âRpt3PayDiscAmtâ, T1.âRpt1Roundingâ,
T1.âRpt2Roundingâ, T1.âRpt3Roundingâ, T1.âRpt1UnpostedBalâ, T1.âRpt2UnpostedBalâ, T1.âRpt3UnpostedBalâ,
T1.âRateGrpCodeâ, T1.âDocDepAppliedâ, T1.âRpt1DepGainLossâ, T1.âRpt2DepGainLossâ, T1.âRpt3DepGainLossâ,
T1.âApplyDateâ, T1.âFiscalYearSuffixâ, T1.âFiscalCalendarIDâ, T1.âSysRowIDâ, T1.âSysRevIDâ, T1.âTaxPointâ,
T1.âTaxRateDateâ, T1.âTaxRegionCodeâ, T1.âLastChrgCalcDateâ, T1.âTranDocTypeIDâ, T1.âTotFinChrgâ,
T1.âDocumentPrintedâ, T1.âPayDiscDaysâ, T1.âPayDiscPerâ, T1.âBlockedFinChrgâ, T1.âBlockedFinChrgReasonâ,
T1.âWithholdAmtâ, T1.âDocWithholdAmtâ, T1.âRpt1WithholdAmtâ, T1.âRpt2WithholdAmtâ, T1.âRpt3WithholdAmtâ,
T1.âBlockedRemLettersâ, T1.âPayDiscPartPayâ, T1.âBlockedRemLettersReasonâ, T1.âBitFlagâ, T1.âShipDateâ,
T1.âCurrRateDateâ, T1.âPIPaymentâ, T1.âPMUIDâ, T1.âUseAltBillToâ, T1.âInPriceâ, T1.âCorrectionInvâ,
T1.âTaxRateGrpCodeâ, T1.âLockTaxRateâ, T1.âSEBankRefâ, T1.âGUITaxTypeCodeâ, T1.âGUIFormatCodeâ,
T1.âGUIDeductCodeâ, T1.âGUIWineCigaretteâ, T1.âReversalDocAmountâ, T1.âOrigDueDateâ, T1.âHeadNumâ,
T1.âARLOCIDâ, T1.âContractRefâ, T1.âOurBankâ, T1.âContractDateâ, T1.âPBProjectIDâ, T1.âDepositAmtâ,
T1.âGUIExportBillNumberâ, T1.âDocDepositAmtâ, T1.âGUIDateOfExportâ, T1.âRpt1DepositAmtâ, T1.âGUIExportTypeâ,
T1.âRpt2DepositAmtâ, T1.âGUIExportMarkâ, T1.âRpt3DepositAmtâ, T1.âGUIExportBillTypeâ, T1.âDepUnallocatedAmtâ,
T1.âSummarizationDateâ, T1.âDocDepUnallocatedAmtâ, T1.âBillingDateâ, T1.âRpt1DepUnallocatedAmtâ, T1.âBillingNumberâ,
T1.âRpt2DepUnallocatedAmtâ, T1.âReadyToBillâ, T1.âRpt3DepUnallocatedAmtâ, T1.âOvrDefTaxDateâ, T1.âXRefContractNumâ,
T1.âXRefContractDateâ, T1.âMainSiteâ, T1.âSiteCodeâ, T1.âBranchIDâ, T1.âCustAgentNameâ, T1.âCustAgentTaxRegNoâ,
T1.âExportTypeâ, T1.âExportReportNoâ, T1.âRealEstateNoâ, T1.âExcludedâ, T1.âDeferredâ, T1.PROGRESS_RECID,
T1.PROGRESS_RECID_IDENT_, T1.âtimestampâ
FROM âdboâ.âInvcDtlâ T0, âdboâ.âInvcHeadâ T1
WHERE ((T0.âCompanyâ = @P1) AND (T0.âCOSPostingReqdâ = @P2) AND (T0.âCOSPostedâ = @P3) AND (T1.âCompanyâ = @P4) AND (T1.âApplyDateâ >= @P5
AND T1.âApplyDateâ < DATEADD(DAY,1, @P6)) AND (T1.âPostedâ = @P7) AND (T0.âInvoiceNumâ = T1.âInvoiceNumâ))
ââCCâ,1,0,âCCâ,â2021-07-02 00:00:00â,â2021-07-02 00:00:00â,1
Hi Justin,
I have not looked at the two statements in detail at all and cant vouch for their accuracy etc. I just download the dashboard posted by Andy and installed it to get the information I posted (ie from the BAQ queries in the dashboard). One is labour related and one is part related.
cheers
Paul