仅显示datagridview中的筛选列 [英] showing only the filtered column in the datagridview

查看:438
本文介绍了仅显示datagridview中的筛选列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手和学生我有一个窗体,其中有一个datadrid视图。我在sql server中有表,我已经与datagrid绑定了,在表中有一个3列,其中一列名为date-small-time-time数据类型,我只是将datagrid视图绑定到表中它显示我希望过滤三列的所有行。我有三列第一列是名称第二列是姓,第三列是日期日期包含smalldatetime数据类型,我希望显示所有三列,但列有日期列为30/12/12 if日期是2012年12月31日意味着从上一个日期的记录抱歉不好的解释我英语很弱我不知道在这里使用什么我能实现这个吗?

解决方案

尝试:

  SELECT  *  FROM  myTable  WHERE   CONVERT  date  ,[ date ])= CONVERT( date ,DATEADD(d,-1,GETDATE())) 


i am a newbie and a student i have a windows form in which is have a datadrid view. i have table in sql server, i have binded with the datagrid, in the table there is a 3 column and in which one column named date of small-date-time datatype, i just binded the datagrid view to the table and it is showing all the rows of the three column i want to filter that. i have three column one is "name" second is "surname" and third is "date" date contains smalldatetime datatype and i want to show all the three columns but the columns which has the "date" columns as 30/12/12 if the date is 31/12/12 means the record from the previous date sorry for the bad explanation i am weak in english i dont know what to use here can i achieve this?

解决方案

Try:

SELECT * FROM myTable WHERE CONVERT(date, [date])=CONVERT(date, DATEADD(d, -1, GETDATE()))


这篇关于仅显示datagridview中的筛选列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆