create table test
(namex varchar(10) null
)
insert into test (namex) values ('1')
--(1)
select CONVERT(varchar(10),CONVERT(date, GETDATE())) from test
--결과 : 2017-08-16
--(2)
select CONVERT(varchar(10),CONVERT(date, GETDATE())) from test where namex ='1'
--결과 : Aug 16 201
--(3)
select Convert(Date,GETDATE()) from test
--결과 : 2017-08-16
--(4)
select Convert(Date,GETDATE()) from test where namex ='1'
--결과 : 2017-08-16
--(5)
select Convert(char(10),getdate(),120) from test
--결과 : 2017-08-16
--(6)
select Convert(char(10),getdate(),120) from test where namex ='1'
--결과 : 2017-08-16
--(7)
select Convert(char(10),getdate(),120)
--결과 : 2017-08-16
(2) 번 쿼리의 결과 값만 다르게 표현됩니다.
왜 저렇게 나오는 건가요,?
감사합니다.
좋은하루 보내세요.
Comment 1
-
건우아빠
2017.08.21 12:05
표현되는 형식이 2번째는 월이 영문3자리로 표현됩니다.
자릿수를 늘려서 보여주시면 됩니다.