Foxtable(狐表)用户栏目专家坐堂 → 临时表SQL查询


  共有4204人关注过本帖平板打印复制链接

主题:临时表SQL查询

帅哥哟,离线,有人找我吗?
zhoushijun
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:146 积分:1259 威望:0 精华:0 注册:2013/1/24 16:21:00
临时表SQL查询  发帖心情 Post By:2013/7/1 14:23:00 [只看该作者]

Dim strsql As String
If values.Length >1 Then
    strsql ="select a.图录号,a.名称,a.作者,a.年代,a.成交价,a.小计,a.买家结算状况,a.买家出帐单日期 ,a.买家付款状况,a.成交状况,a.买方付款,a.竞投牌号,c.姓名 ,a.竞投牌号,b.拍卖会名称 from storeall a inner join auctionall b on a.拍卖会ID=b.拍卖会ID inner join jtdjall c on a.竞投牌号=c.竞投牌号 where a.成交价<> 0 And a.买家结算状况 In('已结算','抵账') and b.拍卖会名称 in(" & s & ") and c.姓名 in(" & name & ")"
Else
    If tb1.text.Trim="" Then
        strsql ="select a.图录号,a.名称,a.作者,a.年代,a.成交价,a.小计,a.买家结算状况,a.买家出帐单日期 ,a.买家付款状况,a.成交状况,a.买方付款,a.竞投牌号,c.姓名 ,a.竞投牌号,b.拍卖会名称 from storeall a inner join auctionall b on a.拍卖会ID=b.拍卖会ID inner join jtdjall c on a.竞投牌号=c.竞投牌号  where a.成交价<> 0 And a.买家结算状况 In('已结算','抵账') and b.拍卖会名称 in(" & s & ") "
    Else
        strsql ="select a.图录号,a.名称,a.作者,a.年代,a.成交价,a.小计,a.买家结算状况,a.买家出帐单日期 ,a.买家付款状况,a.成交状况,a.买方付款,a.竞投牌号,c.姓名 ,a.竞投牌号,b.拍卖会名称 from storeall a inner join auctionall b on a.拍卖会ID=b.拍卖会ID inner join jtdjall c on a.竞投牌号=c.竞投牌号  where a.成交价<> 0 And a.买家结算状况 In('已结算','抵账') and b.拍卖会名称 in(" & s & ") and c.姓名 like '%" & tb1.Text & "%' "
    End If
End If

Dim tem As String=""
Dim cmd As New SQLCommand
cmd.C

Dim dst As Table = Tables("买家结算关联表")
cmd.CommandText=strsql
dst.DataSource = cmd.ExecuteReader()

 

 

 

买家结算关联表是临时表,我上述代码查询不出来数据。sql语句测试过没有问题,是怎么回事?

 

[此贴子已经被作者于2013-7-1 14:24:15编辑过]

 回到顶部