Foxtable(狐表)用户栏目专家坐堂 → 如何 加上 order by


  共有10605人关注过本帖树形打印复制链接

主题:如何 加上 order by

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


加好友 发短信
等级:二尾狐 帖子:532 积分:4020 威望:0 精华:0 注册:2011/6/18 12:41:00
如何 加上 order by  发帖心情 Post By:2011/8/12 9:42:00 [只看该作者]

代码如下

 

Dim txt As String = e.Form.Controls("TextBox1").Text
Dim tbl As Table = Tables("窗口2_Table1")
tbl.Filter= "leveal=2 and deleted=0 and isstop=0 "
If txt = "" Then
    tbl.Filter = "leveal=2 and deleted=0 and isstop=0 "
Else
    txt = "'*" & txt & "*'"
    tbl.filter = "(pfullname Like " & txt & " Or Standard Like " & txt & " Or Unit1 Like " & txt & ") and (leveal=2 and deleted=0 and isstop=0 ) "
End If

 

 

如何 加上 order by pfullname desc,standard desc,unit1 desc

最好是 所有的tbl.filter 都加上 order by pfullname desc,standard desc,unit1 desc

 

 

我加上 order by 后 错误如下:

 

Dim txt As String = e.Form.Controls("TextBox1").Text
Dim tbl As Table = Tables("窗口2_Table1")
tbl.Filter= "leveal=2 and deleted=0 and isstop=0  order by pfullname desc,standard desc,unit1 desc"
If txt = "" Then
    tbl.Filter = "leveal=2 and deleted=0 and isstop=0  order by pfullname desc,standard desc,unit1 desc"
Else
    txt = "'*" & txt & "*'"
    tbl.filter = "(pfullname Like " & txt & " Or Standard Like " & txt & " Or Unit1 Like " & txt & ") and (leveal=2 and deleted=0 and isstop=0 ) order by pfullname desc,standard desc,unit1 desc"
End If

 

 


图片点击可在新窗口打开查看此主题相关图片如下:102.jpg
图片点击可在新窗口打开查看
[此贴子已经被作者于2011-8-12 9:46:16编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/8/12 9:47:00 [只看该作者]

tbl.filter = "(pfullname Like " & txt & " Or Standard Like " & txt & " Or Unit1 Like " & txt & ") and (leveal=2 and deleted=0 and isstop=0 ) "
t.Sort = "pfullname desc,standard desc,unit1 desc"

 

参考:

http://www.foxtable.com/help/topics/0451.htm

 


 回到顶部