February 8, 2011 at 2:57 pm
How can I accomplish this?
select case when Datename(dw,getdate()) = 'Sunday' then
set @dateBegin = Getdate()),
set @date2 = dateadd(dd,1,getdate())
Thanks.
February 8, 2011 at 3:05 pm
TSQL CASE is not the same as other programming languages...
in SQL, CASE is used to return data...to make logical decisions, you have to use IF.ELSE
How can I accomplish this?
IF Datename(dw,getdate()) = 'Sunday'
BEGIN
set @dateBegin = Getdate()),
@date2 = dateadd(dd,1,getdate())
END
ELSE
BEGIN
'so something..
PRINT 'other WORK
END
How can I accomplish this?
select
case
when Datename(dw,getdate()) = 'Sunday'
then Getdate()),
ELSE dateadd(dd,1,getdate())
END
Thanks.
Thanks.
Lowell
February 9, 2011 at 7:59 am
Thank you much. That works.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply