Home > Back-end >  Abnormal results query result data set is correct, statements
Abnormal results query result data set is correct, statements

Time:09-29

StrSQL=Format (' SELECT biggest ustomerName, p. ins, B.M O, B.S tyleID, D.M oid,, dc olorID,, dc olorName, D.S izeName, D.M ugID, D.W PID, D.W PName, arjun OQty, D.I NQty, isNull (D.I nWeight, 0) as InWeight, arjun OQty - isNull (D.I NQty, 0) as UnQty '+
'the FROM (SELECT MOID ColorID, ColorName, SizeName, MugID, WPID, WPName, SUM (Qty) as MOQty' +
'the FROM MO_Detail' +
'GROUP BY MOID ColorID, ColorName, SizeName, MugID, WPID, WPName) A INNER JOIN MO_Main B ON arjun OID=B.M OID' +
'INNER JOIN' +
'(' +
'the SELECT MOID ColorID, ColorName, SizeName MugID, WPID, WPName, SUM (Qty) as INQty, SUM () as InWeight' +
'the FROM v_AllMOIn_Detail % s' +
'GROUP BY MOID ColorID, ColorName, SizeName, MugID, WPID, WPName' +
') ON arjun OID=D D.M OID and A.C olorID=, dc olorID and A.S izeName=D.S izeName '+
'and aleem walji PID=D.W PID % s and isNull (B.i sOVER, 0)=0', [InFilter strFilter]);
MOINDataSet. Data:=DataA. GetDataPacket (strSQL);
Other results are OK, report is InWeight is 0 weight type for Numeric (18, 3)


CodePudding user response:

Weight type Numeric 18, 3

CodePudding user response:

The Sum () as InWeight?

CodePudding user response:

The Sum (weight) as InWeight

CodePudding user response:

I changed to other data types can be, numeric (18, 3) data type

CodePudding user response:

reference 4 floor weitsoft response:
other data types can be changed, I just numeric (18, 3) data types not


Alone make a test table, set a numeric (18, 3) field try

Whether should be numeric (18, 3) the problem of field type

CodePudding user response:

You split the check about whether isNull (D.I nWeight, 0) this time InWeight value is NULL

CodePudding user response:

I change the field type to float is possible

CodePudding user response:

The key is not ISNULL
Also not line

CodePudding user response:

Pass by, learning,

CodePudding user response:

The new road passing through, learn from them