请帮助我如何在日期之间插入 LIKE %
.例子是:
Please help me how to insert LIKE %
in date between. Example is:
SELECT *
FROM table
WHERE Date BETWEEN '" & startDate & "%'" AND '" & endDate & "%'"
所以在这段代码中,我应该把 LIKE
放在什么地方,这样数据才会出现?
So in this code where i should put LIKE
so that data will appear?
如果我这样设置
SELECT *
FROM table
WHERE Date LIKE '" & startDate & "%'"
它正在工作..LIKE
意味着读取 startdate 或 %.. 开始它会读取 %
it's working..LIKE
meant read either startdate or %..for starting it will read %
试试这个:
"Select (listOfFields)
FROM TABLE
where CONVERT(VARCHAR(25), Your_DATE, 126) BETWEEN 'Start_date%' AND 'EndDate%'";
这篇关于LIKE 之间的 SQL Server 日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!