General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
There are plenty of joins in this one. My goal is to have one record in the resulting cursor which is added as a string to a list box. This single record is also inserted into a table that is used to populate a report form.
Select Distinct A.LoomNumber,A.StartDate,A.EndDate,B.iobjnum As ObjNum,;
Left(C.cmodelnumber,20) as LoomType,C.ipicksperinch as LoomPPI,;
E.cgreigestylenumber as GSNumber,;
F.ipicksperinch as GStyPPI, F.inumberofstrips as Strips,;
H.ncompress as Compression,;
G.tstopstart as StopStart, G.tstopend as StopEnd,;
SUM(G.ipickcount) as Picks,;
SUM((G.ipickcount/(C.ipicksperinch*36))* H.ncompress) as Yardage;
From SQLBase A Left Join ObjParameters B on A.LoomNumber == B.cloomnumber;
Left Join ObjTypes C on C.iobjtypeid = B.iobjtypeid;
Left Join SegmentCurrent D on D.iobjnum = B.iobjnum;
Left Join SegStopsCurrent G on G.iobjnum = B.iobjnum;
Left Join GreigeStyles E on E.igrgstyid = D.igrgstyid;
Left Join GreigeStyleObjType F on F.igrgstyid = E.igrgstyid;
Left Join GreigeStylesWarps H on H.igrgobjid = F.igrgobjid;
Into Cursor curReport;
Where A.loomnumber = pcLoomNumber AND;
G.tstopstart >= CTOT(A.Startdate) AND;
G.tstopend <= CTOT(A.EndDate)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only