so here is the query that you can use:
select DATENAME(dw ,
you can pass "dw" or "weekday" as a first parameter to date name which specifies the part of date returned.
so a sample query will be
SELECT case when DATENAME(dw , getdate()) <> 'Sunday' then 'Its Not Sunday today' else 'Its Sunday today' end
since today is friday the result was
"Its Not Sunday today"
No rocket science, just doing small things the right way!
No comments:
Post a Comment