我的SQL数据库里有一个字段为datatime(DTIME),我想取两个时间段之间的数据,请问SQL语句怎么写?

我的SQL数据库里有一个字段为datatime(DTIME),我想取两个时间段之间的数据,请问SQL语句怎么写?,第1张

select datatime from 表名 where

datatime BETWEEN value1 AND value2 order by datatime desc

其中between and取出两个时间段之间的数据,order by排序,desc倒序(即先后)

select substring(字段,charindex(',',字段)+1,charindex(',',字段,charindex(',',字段)+1)-charindex(',',字段)-1) from 表

str_sql := Format('select * from OrderBill where BillNo between %s and %s', [QuotedStr(edit1.Text), QuotedStr(edit2.Text)])


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/9971461.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-03
下一篇2023-05-03

发表评论

登录后才能评论

评论列表(0条)

    保存