sddsf dfgfg dfg fdggg dfg
SQL_Select Statement Example mySQL_Select = "SELECT" mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(1) & "]," mySQL_Select = mySQL_Select + " Sum([" & tempInputTable & "].[" & tempField_I(2) & "]) AS [" & tempField_O(2) & "]," mySQL_Select = mySQL_Select + " Count([" & tempInputTable & "].[" & tempField_I(3) & "]) AS [" & tempField_O(3) & "]," mySQL_Select = mySQL_Select + " Avg([" & tempInputTable & "].[" & tempField_I(4) & "]) AS [" & tempField_O(4) & "]," mySQL_Select = mySQL_Select + " Sum([" & tempInputTable & "].[" & tempField_I(5) & "]) AS [" & tempField_O(5) & "]," mySQL_Select = mySQL_Select + " [" & tempField_O(5) & "]/[" & tempField_O(2) & "] AS [" & tempField_O(6) & "]" mySQL_Select = "SELECT" mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(1) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(2) & "] AS [" & tempField_O(2) & "]," mySQL_Select = mySQL_Select + " '" & tempField_I(3) & "' AS [" & tempField_O(3) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(4) & "] AS [" & tempField_O(4) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(5) & "] AS [" & tempField_O(5) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(6) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(7) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(8) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(9) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_I(10) & "]," mySQL_Select = mySQL_Select + " '" & tempField_I(11) & "' AS " & tempField_O(11) mySQL_Select = "SELECT" For j = 1 To totalFields - 1 mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & fieldName(j) & "]," Next j mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & fieldName(totalFields) & "]" mySQL_Select = "SELECT" mySQL_Select = mySQL_Select + " [" & tempYYYYMM & "]." & tempField_O(1) & "," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_O(2) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_O(3) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_O(4) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_O(5) & "]," mySQL_Select = mySQL_Select + " [" & tempInputTable & "].[" & tempField_O(6) & "]" mySQL_Select = "SELECT" mySQL_Select = mySQL_Select + " [" & tempInputTable & "]." & tempField_O(1) & "," For j = 2 To totalFields_O - 1 mySQL_Select = mySQL_Select + " IIf(IsNull([" & tempInputTable & "]![" & tempField_O(2) & "]),0,[" & tempInputTable & "]![" & tempField_O(j) & "]) AS [" & tempField_O(j) & "]," Next j mySQL_Select = mySQL_Select + " IIf(IsNull([" & tempInputTable & "]![" & tempField_O(2) & "]),0,[" & tempInputTable & "]![" & tempField_O(6) & "]) AS [" & tempField_O(6) & "]" .msgcontent .wsharing ul li { text-indent: 0; } 分享 Facebook Plurk YAHOO!
好站連結:http://tw.myblog.yahoo.com/clement212316
留言列表