--按年  
  select   *   from   表名   where   format(字段名,"yyyy")=你输入的年份  
   
  --按月  
  select   *   from   表名   where   format(字段名,"mm")=你输入的月份  
   
  --按年月,注意你的年月要转换为200606类似的格式  
  select   *   from   表名   where   format(字段名,"yyyymm")=你输入的年月  
   
  --或者直接用year()、Month()函数。  
   
  select   *   from   表名   where   year(字段名)=你输入的年   and   month(字段名)=你输入的月

相关文章:

  • 2021-09-24
  • 2022-12-23
  • 2021-06-28
  • 2021-11-13
  • 2021-10-21
  • 2022-02-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案