在存储过程中,需要时间的计算,在表中的时间格式为'2006-8-1 00:00:00',现在想设定一个变量@TIME表示月份,如:输入@TIME值为'2006年8月',就表示为'2006-8-1 00:00:00'--'2006-9-1 00:00:00',该怎么写啊?
re:
declare @vTimeStr varchar(50)
set @vTimeStr=convert(char(10),dateadd(mm,1,getdate()),120)+' 00:00:00'
select @vTimeStr