MS-SQL
Oracle
--
備忘一下
--
select GETDATE() today,
convert(datetime,convert(char(8), YEAR(getdate()) * 10000 + MONTH(getdate()) * 100 + '01', 112)) month_start,
convert(char(6),dateadd(month,1,getdate()),112)+'01' next_month,
dateadd(day, -1, convert(datetime,(convert(char(6),dateadd(month,1,getdate()),112)+'01'))) month_end
Oracle
select * from OPENQUERY(ORACLE_PROD,'
select to_date(to_char(sysdate,''yyyymm'') || ''01'', ''yyyymmdd'') month_start,
trunc(last_day(sysdate)) month_end
from dual
')
--
備忘一下
--
留言
張貼留言
請留下你的身分~
可用「Google帳戶」登入,或使用「名稱/網址」!❤
用匿名的話,我真的不知道你是誰喔!