JordyBarneveld
Gebruiker
- Lid geworden
- 12 sep 2007
- Berichten
- 49
Hallo,
Ik ben op zoek naar een oplossing voor een functie in een ERP systeem. Er is een mogelijkheid om binnen het pakket met SQL taal een eigen scherm te bouwen. ik zoek nu een oplossing om twee kolomen te vergelijken. Misschien dat iemand me hier mee kan helpen. Tot nu toe heb ik de twee kolomen bijelkaar gekregen:
(een beetje lang stukje tekst maar ik ben verplicht alle data in het scherm te zetten die in de gebruikelijke scherm zit)
De vraag is om de twee data te vergelijken en in een nieuwe kolom het verschil aan te geven. (ik heb de data functie vet gemaakt).
Dus kan ik een fuctie maken waar ik een nieuwe kolom krijg met als resultaat het verschil van de 2 data?
Zie de sql tekst:
select
IsNull(IsNull(ProductionHeaderTree.StartDate, ProductionHeaderTree.EndDate), Convert(datetime, Convert(varchar(30), GetDate(), 112)))StartDateGantt
, DateAdd(ss, 86399, IsNull(IsNull(ProductionHeaderTree.EndDate, ProductionHeaderTree.StartDate), Convert(datetime, Convert(varchar(30), GetDate(), 112)))) EndDateGantt
, Convert(bit, ProductionHeaderTree.ProdHeaderCompletedInd) ProdHeaderCompletedInd
, ProductionHeaderTree.ProdHeaderOrdNr
, "ParentProdHeaderDossierCode" = Convert(char(10), Null)
, ProductionHeaderTree.DossierCode
, ProductionHeaderTree.ProdHeaderDossierCode
, ProductionHeaderTree.PartCode
, ProductionHeaderTree.Description
, ProductionHeaderTree.Qty
, ProductionHeaderTree.StartDate
, ProductionHeaderTree.EndDate
, ProductionHeaderTree.LastUpdatedOn
, ProductionHeaderTree.ProdStatusCode
, ProductionHeaderTree.RevisionNr
, ProductionHeaderTree.CustPartCode
, ProductionHeaderTree.ProdStatusDescription
, ProductionHeaderTree.ProdHeaderType
, ProductionHeaderTree.MRPCreatedInd
, ProductionHeaderTree.ProdHeaderCompletedDate
, ProductionHeaderTree.LongDeliveryLeadTimeItemsInd
, ProductionHeaderTree.PriorityId
, ProductionHeaderTree.PriorityCode
, ProductionHeaderTree.PriorityDescription
, ProductionHeaderTree.ServObjectCode
, ProductionHeaderTree.ServTypeCode
, ProductionHeaderTree.RespEmpId
, ProductionHeaderTree.EmpMnem
, ProductionHeaderTree.ProdStatusProdStatusType
, ProductionHeaderTree.OrdNr
, ProductionHeaderTree.QuotNr
, ProductionHeaderTree.CustId
, ProductionHeaderTree.Mnem
, ProductionHeaderTree.StartDateActual
, ProductionHeaderTree.EndDateActual
, ProductionHeaderTree.ProgressPercentage
, ProductionHeaderTree.PlanningConstraintType
, ProductionHeaderTree.PlanningConstraintDate
, ProductionHeaderTree.PlanType
, ProductionHeaderTree.MemoGrpId
, T_Part.PurPartGrpCode
, T_Part.EngPartGrpCode /* eng code */
, T_Part.Stand
, T_Part.VendId /* inkoopgroep */
, T_PurDocPartLine.ReceiptDate /* einddatum inkoopdeel */
, T_PurPartGrp.Description /* inkoopgroep */
, T_PurchaseDocument.VendId
From ProductionHeaderTree
, T_part
, T_PurPartGrp
, T_ProductionHeader
, T_PurDocPartLine
, T_PurDocPartLineProdBOMLink
, T_PurchaseDocument
where ProductionHeaderTree.partcode = T_part.partcode
and T_PurPartGrp.PurPartGrpCode = T_Part.PurPartGrpCode
and T_ProductionHeader.ProdHeaderDossierCode = ProductionHeaderTree.ProdHeaderDossierCode
and T_PurDocPartLine.PurDocCode = T_PurDocPartLineProdBOMLink.PurDocCode
and T_PurDocPartLine.PDPartLineNr = T_PurDocPartLineProdBOMLink.PDPartLineNr
and T_PurDocPartLineProdBOMLink.ProdHeaderDossierCode = T_ProductionHeader.ProdHeaderDossierCode
and T_PurchaseDocument.PurDocCode = T_PurDocPartLine.PurDocCode
Ik ben op zoek naar een oplossing voor een functie in een ERP systeem. Er is een mogelijkheid om binnen het pakket met SQL taal een eigen scherm te bouwen. ik zoek nu een oplossing om twee kolomen te vergelijken. Misschien dat iemand me hier mee kan helpen. Tot nu toe heb ik de twee kolomen bijelkaar gekregen:
(een beetje lang stukje tekst maar ik ben verplicht alle data in het scherm te zetten die in de gebruikelijke scherm zit)
De vraag is om de twee data te vergelijken en in een nieuwe kolom het verschil aan te geven. (ik heb de data functie vet gemaakt).
Dus kan ik een fuctie maken waar ik een nieuwe kolom krijg met als resultaat het verschil van de 2 data?
Zie de sql tekst:
select
IsNull(IsNull(ProductionHeaderTree.StartDate, ProductionHeaderTree.EndDate), Convert(datetime, Convert(varchar(30), GetDate(), 112)))StartDateGantt
, DateAdd(ss, 86399, IsNull(IsNull(ProductionHeaderTree.EndDate, ProductionHeaderTree.StartDate), Convert(datetime, Convert(varchar(30), GetDate(), 112)))) EndDateGantt
, Convert(bit, ProductionHeaderTree.ProdHeaderCompletedInd) ProdHeaderCompletedInd
, ProductionHeaderTree.ProdHeaderOrdNr
, "ParentProdHeaderDossierCode" = Convert(char(10), Null)
, ProductionHeaderTree.DossierCode
, ProductionHeaderTree.ProdHeaderDossierCode
, ProductionHeaderTree.PartCode
, ProductionHeaderTree.Description
, ProductionHeaderTree.Qty
, ProductionHeaderTree.StartDate
, ProductionHeaderTree.EndDate
, ProductionHeaderTree.LastUpdatedOn
, ProductionHeaderTree.ProdStatusCode
, ProductionHeaderTree.RevisionNr
, ProductionHeaderTree.CustPartCode
, ProductionHeaderTree.ProdStatusDescription
, ProductionHeaderTree.ProdHeaderType
, ProductionHeaderTree.MRPCreatedInd
, ProductionHeaderTree.ProdHeaderCompletedDate
, ProductionHeaderTree.LongDeliveryLeadTimeItemsInd
, ProductionHeaderTree.PriorityId
, ProductionHeaderTree.PriorityCode
, ProductionHeaderTree.PriorityDescription
, ProductionHeaderTree.ServObjectCode
, ProductionHeaderTree.ServTypeCode
, ProductionHeaderTree.RespEmpId
, ProductionHeaderTree.EmpMnem
, ProductionHeaderTree.ProdStatusProdStatusType
, ProductionHeaderTree.OrdNr
, ProductionHeaderTree.QuotNr
, ProductionHeaderTree.CustId
, ProductionHeaderTree.Mnem
, ProductionHeaderTree.StartDateActual
, ProductionHeaderTree.EndDateActual
, ProductionHeaderTree.ProgressPercentage
, ProductionHeaderTree.PlanningConstraintType
, ProductionHeaderTree.PlanningConstraintDate
, ProductionHeaderTree.PlanType
, ProductionHeaderTree.MemoGrpId
, T_Part.PurPartGrpCode
, T_Part.EngPartGrpCode /* eng code */
, T_Part.Stand
, T_Part.VendId /* inkoopgroep */
, T_PurDocPartLine.ReceiptDate /* einddatum inkoopdeel */
, T_PurPartGrp.Description /* inkoopgroep */
, T_PurchaseDocument.VendId
From ProductionHeaderTree
, T_part
, T_PurPartGrp
, T_ProductionHeader
, T_PurDocPartLine
, T_PurDocPartLineProdBOMLink
, T_PurchaseDocument
where ProductionHeaderTree.partcode = T_part.partcode
and T_PurPartGrp.PurPartGrpCode = T_Part.PurPartGrpCode
and T_ProductionHeader.ProdHeaderDossierCode = ProductionHeaderTree.ProdHeaderDossierCode
and T_PurDocPartLine.PurDocCode = T_PurDocPartLineProdBOMLink.PurDocCode
and T_PurDocPartLine.PDPartLineNr = T_PurDocPartLineProdBOMLink.PDPartLineNr
and T_PurDocPartLineProdBOMLink.ProdHeaderDossierCode = T_ProductionHeader.ProdHeaderDossierCode
and T_PurchaseDocument.PurDocCode = T_PurDocPartLine.PurDocCode