仅显示datagridview中的筛选列 [英] showing only the filtered column in the 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屋!