Home  >  Article  >  Database  >  截取日期参数中的月和日

截取日期参数中的月和日

WBOY
WBOYOriginal
2016-06-07 14:53:401505browse

截取日期参数中的月和日 select * from table where substring(CONVERT(varchar(12),colum,112),5,4) between 0101 and 0505 查询1月1日到5月5日之间 www.2cto.com 如果是截取单个,如月份 select colum (mm,fdBirthDay) from table


截取日期参数中的月和日

 

select * from table where 

 

substring(CONVERT(varchar(12),colum,112),5,4) between '0101' and '0505' 

 

查询1月1日到5月5日之间 

  www.2cto.com  

如果是截取单个,如月份 

 

select colum (mm,fdBirthDay) from table

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn