以文本方式查看主題 - 昂捷論壇 (http://m.yzsenyi.com/bbs/index.asp) -- □-系統(tǒng)配置管理類 (http://m.yzsenyi.com/bbs/list.asp?boardid=34) ---- 如何查詢自定義表單數(shù)據(jù)表中信息 (http://m.yzsenyi.com/bbs/dispbbs.asp?boardid=34&id=8239) |
-- 作者:czg1981 -- 發(fā)布時(shí)間:2012/4/10 15:02:02 -- 如何查詢自定義表單數(shù)據(jù)表中信息 自定義表單中增加了數(shù)據(jù)表格的控件,如果要將數(shù)據(jù)表格中的內(nèi)容都獲取,可以用cross apply來(lái)獲取,例如下面的例子 select t.node.value(\'c_col1[1]\',\'varchar(1000)\') as c_col1,
注:c_col1至c_col5代表數(shù)據(jù)表格中列明稱; c_partake_days為數(shù)據(jù)表格名稱
|
-- 作者:lsd4525 -- 發(fā)布時(shí)間:2012/12/29 10:31:26 -- select convert(char(10),c_au_dt,120) as 日期, c_id as 單據(jù)號(hào), c_au_userno+u.c_name as 操作員, t.node.value(\'c_col1[1]\',\'varchar(1000)\') as 沃爾瑪卡號(hào), t.node.value(\'c_col2[1]\',\'varchar(1000)\') as 新象城卡號(hào), t.node.value(\'c_col3[1]\',\'varchar(1000)\') as 類型, t.node.value(\'c_col4[1]\',\'varchar(1000)\') as 面值, t.node.value(\'c_col5[1]\',\'varchar(1000)\') as 手續(xù)費(fèi), t.node.value(\'c_col6[1]\',\'varchar(1000)\') as 合計(jì), t.node.value(\'c_col7[1]\',\'varchar(1000)\') as 現(xiàn)金, t.node.value(\'c_col8[1]\',\'varchar(1000)\') as 銀行卡, t.node.value(\'c_col9[1]\',\'varchar(1000)\') as 付款合計(jì), t.node.value(\'c_col10[1]\',\'varchar(1000)\') as 備注 from tbc_eform_data td cross apply c_data.nodes(\'/rows/row/DateList/drows/drow\') as t(node),tb_user u where td.c_au_userno=u.c_userno and c_eform_guid=\'770831CD-5A88-4C4F-B70D-A9A681E1FF25\' and td.c_status=\'已審核\' and (@操作員=\'\'or @操作員 is null or c_au_userno=@操作員) and (@類型 is null or @類型=\'\' or c_data.value(\'(/rows/row/DateList/drows/drow/c_col3)[1]\',\'nvarchar(max)\')=@類型) and t.node.value(\'c_col1[1]\',\'varchar(1000)\')<>\'\' and td.c_status=\'已審核\' and datediff(day,c_au_dt,@開始日期)<=0 and datediff(day,c_au_dt,@結(jié)束日期)>=0 |