本文介绍了过滤两个日期列之间的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我知道如何过滤1列内的日期,但是如何在2列之间过滤? 示例选择*来自@startyear和@endyear之间的雇员雇用,sqlcon sqladapt.SelectCommand.Parameters.AddWithValue(@ startyear,start.Text) sqladapt.SelectCommand.Parameters.AddWithValue(@ endyear,end .Text) 单列有很多例子,但我在使用2个日期列时找不到多少。 有人可以帮我这个 我试过的: 我试过SELECT * FROM [Employeetable] where [Hiredate]> @startyear和[Lastday]< @endyear, sqlcon sqladapt.SelectCommand.Parameters.AddWithValue(@ startyear,start.Text) sqladapt.SelectCommand.Parameters.AddWithValue(@ endyear,end.Text) 都是日期解决方案 I know how to filter dates inside of 1 column, but how do you filter between 2 columns?Example "Select * from Employeetable hiredate between @startyear and @endyear, sqlcon"sqladapt.SelectCommand.Parameters.AddWithValue("@startyear", start.Text) sqladapt.SelectCommand.Parameters.AddWithValue("@endyear", end.Text)there are quite a few examples for a single column but I cannot find much on using 2 date columns.can someone help me with thisWhat I have tried:I have tried "SELECT * FROM [Employeetable] where [Hiredate] > @startyear and [Lastday] < @endyear, sqlcon"sqladapt.SelectCommand.Parameters.AddWithValue("@startyear", start.Text) sqladapt.SelectCommand.Parameters.AddWithValue("@endyear", end.Text)both are dates 解决方案 这篇关于过滤两个日期列之间的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-11 14:16