Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need help to take away double rows in my application, see attached file. The only row that should be left are third row. Can I do something in the script?
/Jessica
Try adding this to the script:
CSTREASON: //This names the table so you can join to it.
SQL SELECT //bDefault,
//bPTDefRecWaste,
//bPTDefWaste,
//bWebBreak,
//nFacEventTypeId,
nId as ReasonId,
//nSortOrder,
//strCode,
strName as Stopporsak
FROM "mwm_ct_jms".dbo.CSTREASON WHERE strName NOT LIKE '-';
Left Keep (CSTREASON)
SQL SELECT //bLastStop,
//bManual,
//fEndOffset,
//fOffset,
//fRadius,
//nAutomaticEventTypeId,
//nColumnB,
//nCopies,
//nCopyOf,
//nDampPercentage,
//nEventTypeId,
//nExtraCopiesChange,
//nFacEventTypeId,
//nForm,
nId,
//nMachineId as MachineId,
//nMainId,
nOperatorId,
nPaperTension,
//nProcessTypeId,
nReasonId as ReasonId,
//nRepLineRunId,
nRepMachineRunId as RepMachineRunId,
//nRepProductRunId,
//nRepRollId,
//nRepSessionId,
//nRepVersionRunId,
//nRevolutionSpeedBeforeStop,
//nShiftEventId,
//nShiftId,
//nShiftSupervisorId,
nUnitId as UnitId,
nUnitTypeId as UnitTypeId,
//nUsageId,
strComment as Kommentar,
//strPictureFile,
tmEndTime,
//tmInserted,
tmTime,
Year (tmTime) as År,
Month (tmTime) as Mån,
Day (tmTime) as Dag
FROM "mwm_ct_jms".dbo.REPEVENT;
Try adding Inner Joins to your script.
Can you be more specific? Example?
Thanks
/Jessica
Can you post your script?
How do you know it's the third row you want? Whatever that condition is, add it to the script that loads the table.
Marcsliving - You can find the script above. ct.qvs
John - I think I want the third row because there must allways be a value in the column "stopporsak"
How do all your tables connect? A table view would be helpful (Would take awhile to search through for matching fields to build myself)
If you always need the field Stopporsak to be populated, then you need to place a join on that table with the connecting table (This is if stopporsak is a description table if the table with stopporsak actually has records with no entry to can place a where clause like: from table where stopporsak<>'').
See view CT file above.
Yes,there must allways be a value in Stopporsak
Try adding this to the script:
CSTREASON: //This names the table so you can join to it.
SQL SELECT //bDefault,
//bPTDefRecWaste,
//bPTDefWaste,
//bWebBreak,
//nFacEventTypeId,
nId as ReasonId,
//nSortOrder,
//strCode,
strName as Stopporsak
FROM "mwm_ct_jms".dbo.CSTREASON WHERE strName NOT LIKE '-';
Left Keep (CSTREASON)
SQL SELECT //bLastStop,
//bManual,
//fEndOffset,
//fOffset,
//fRadius,
//nAutomaticEventTypeId,
//nColumnB,
//nCopies,
//nCopyOf,
//nDampPercentage,
//nEventTypeId,
//nExtraCopiesChange,
//nFacEventTypeId,
//nForm,
nId,
//nMachineId as MachineId,
//nMainId,
nOperatorId,
nPaperTension,
//nProcessTypeId,
nReasonId as ReasonId,
//nRepLineRunId,
nRepMachineRunId as RepMachineRunId,
//nRepProductRunId,
//nRepRollId,
//nRepSessionId,
//nRepVersionRunId,
//nRevolutionSpeedBeforeStop,
//nShiftEventId,
//nShiftId,
//nShiftSupervisorId,
nUnitId as UnitId,
nUnitTypeId as UnitTypeId,
//nUsageId,
strComment as Kommentar,
//strPictureFile,
tmEndTime,
//tmInserted,
tmTime,
Year (tmTime) as År,
Month (tmTime) as Mån,
Day (tmTime) as Dag
FROM "mwm_ct_jms".dbo.REPEVENT;
Thanks! Now it works