|
-
May 2nd, 2007, 07:35 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] math.min
hello! anybody can help me?
SELECT MAX(MV)-MIN(MV) as range_mv,STDEV(MV) as stdev_mv,(SELECT MV_MAX-MV_MIN FROM tblStandard WHERE COMPOUND_NO='" + cboCompoundNo.Text + "')/6*STDEV(MV) as cp_mv,(AVG(MV)-(SELECT MV_MIN FROM tblStandard WHERE COMPOUND_NO ='" + cboCompoundNo.Text + "'))/3*STDEV(MV) as cpl_mv,((SELECT MV_MAX FROM tblStandard WHERE COMPOUND_NO ='" + cboCompoundNo.Text + "')-AVG(MV))/3*STDEV(MV) as cpu_mv FROM tblData WHERE COMPOUND_NO = '" + cboCompoundNo.Text + "' AND MIXING_DATE BETWEEN #" + dtpFrom.Text + "# AND #" + dtpTo.Text + "#";
above code generate output ok
getting the MINIMUM and INSERT the value is like this:
"INSERT INTO tblData(...) VALUES(...," + Math.Min(oDR["cpl_mv"],oDR["cpl_mv"]) + ")";
error msg: "Cannot convert from object to sbyte"
i passed the values but the same error occurs
cpl_mv = oDR["cpl_mv"];
cpu_mv = oDR["cpu_mv"];
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|