开发者

SQL date related

开发者 https://www.devze.com 2023-01-17 11:30 出处:网络
Hi all开发者_运维技巧 i want to take record from table named Tblbatch where batch starting date should be from augest 2007 to july 2010...

Hi all开发者_运维技巧 i want to take record from table named Tblbatch where batch starting date should be from augest 2007 to july 2010... I want to fetch such records which came in between this two dates


Select * from Tblbatch where startDate between '01-08-2007' and '31-07-2010'
  • provided you have a datetime column "startDate"

Note : that using between includes both the dates specified. If you want to avoid the dates either change the boundary dates to + - 1 respectively or use > and < conditions

0

精彩评论

暂无评论...
验证码 换一张
取 消