sql server中datetime字段去除时间的语句

时间:2024-01-23 17:47:57 

select CONVERT(varchar, getdate(), 120 ) 
2004-09-12 11:06:08 

select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),\'-\',\'\'),\' \',\'\'),\':\',\'\') 
20040912110608 

select CONVERT(varchar(12) , getdate(), 111 ) 
2004/09/12 

select CONVERT(varchar(12) , getdate(), 112 ) 
20040912 

select CONVERT(varchar(12) , getdate(), 102 ) 
2004.09.12 

select CONVERT(varchar(12) , getdate(), 101 ) 
09/12/2004 

select CONVERT(varchar(12) , getdate(), 103 ) 
12/09/2004 

select CONVERT(varchar(12) , getdate(), 104 ) 
12.09.2004 

select CONVERT(varchar(12) , getdate(), 105 ) 
12-09-2004 

select CONVERT(varchar(12) , getdate(), 106 ) 
12 09 2004 

select CONVERT(varchar(12) , getdate(), 107 ) 
09 12, 2004 

select CONVERT(varchar(12) , getdate(), 108 ) 
11:06:08 

select CONVERT(varchar(12) , getdate(), 109 ) 
09 12 2004 1 

select CONVERT(varchar(12) , getdate(), 110 ) 
09-12-2004 

select CONVERT(varchar(12) , getdate(), 113 ) 
12 09 2004 1 

select CONVERT(varchar(12) , getdate(), 114 ) 
11:06:08.177 

select CONVERT(varchar(10) , getdate(), 120 ) 

标签:sql,server中datetime字段去除时间的语句
0
投稿

猜你喜欢

  • Python函数参数定义及传递方式解析

    2021-10-19 21:28:25
  • python相对包导入报“Attempted relative import in non-package”错误问题解决

    2022-02-28 12:57:05
  • 使用 JScript 创建 .exe 或 .dll 文件

    2011-06-04 15:37:00
  • MySQL数据库如何给表设置约束详解

    2024-01-20 18:28:30
  • python调用并链接MATLAB脚本详解

    2021-12-11 07:16:42
  • mysql 5.7.20\\5.7.21 免安装版安装配置教程

    2024-01-26 14:05:33
  • MySQL5.7中的sql_mode默认值带来的坑及解决方法

    2024-01-25 08:34:29
  • MySQL实战记录之如何快速定位慢SQL

    2024-01-27 07:58:12
  • 关于PowerDesigner初体验的使用介绍

    2024-01-13 04:15:25
  • Python基础篇之初识Python必看攻略

    2021-02-21 11:26:10
  • 基于Python函数和变量名解析

    2022-10-26 13:49:56
  • Python常用内置函数的使用教程详解

    2021-11-11 21:23:50
  • Python工程师必考的6个经典面试题

    2021-07-01 02:55:32
  • 计划备份mysql数据库

    2009-03-09 14:34:00
  • Scrapy爬虫文件批量运行的实现

    2022-04-25 18:29:57
  • MySQL 利用frm文件和ibd文件恢复表数据

    2024-01-28 08:46:53
  • JavaScript监听和禁用浏览器回车事件实例

    2023-10-12 01:58:16
  • 浅谈如何使用Python控制手机(一)

    2023-03-11 14:18:47
  • 关于mysql基础知识的介绍

    2024-01-18 10:57:28
  • python实现图片插入文字

    2021-11-02 20:32:09
  • asp之家 网络编程 m.aspxhome.com