呃,需要这样写
cmd.CommandText = "SELECT Year(CP_CK01.SHSJ) As 年, Month(CP_CK01.SHSJ) As 月, GY_LZFS.FSMC, CP_CK01.SHSJ, CP_CPZD.CPBM, CP_CPZD.CPMC, CP_CPZD.CPGG, CP_CPZD.CPYS, CP_CPZD.CPDW, CP_CK02.DHDH, CP_CK02.CPSL, CP_CK02.JSJG, CP_CK02.JSJE, CP_JGXX.XSJG, CP_CK02.DHDH" _
& " FROM ((GY_LZFS INNER JOIN (CP_CK01 INNER JOIN CP_CK02 ON (CP_CK01.LZDH = CP_CK02.LZDH) And (CP_CK01.LZFS = CP_CK02.LZFS)) ON GY_LZFS.LZFS = CP_CK01.LZFS) INNER JOIN CP_CPZD ON CP_CK02.CPXH = CP_CPZD.CPXH) INNER JOIN CP_JGXX ON CP_CK02.CPXH = CP_JGXX.CPXH" _
& " WHERE (((GY_LZFS.FSMC)='销售出库') AND ((CP_JGXX.XSLX)=2) AND ((CP_CK01.DJZT)='AU'));"
dt = cmd.ExecuteReader()
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(dt,"年|月")
trv.Nodes.Insert("加载所有数据",0)
[此贴子已经被作者于2014-5-9 17:01:13编辑过]