Ms Sql Server Fundamentals
Tuesday, October 26, 2010
Get week date range from date
Query
SELECT
CONVERT
(
varchar
(
50
),
(
DATEADD
(
DD
,
@@DATEFIRST
-
DATEPART
(
DW
,
GETDATE
())
-
6
,
GETDATE
())),
106
)
as
[First Date]
,
CONVERT
(
varchar
(
50
),
(
DATEADD
(
DD
,
@@DATEFIRST
-
DATEPART
(
DW
,
GETDATE
()),
GETDATE
())),
106
)
as
[Last Date]
Screen Shot
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Subscribe To My Blog
Posts
Atom
Posts
Comments
Atom
Comments
Readers
My Blog List
LEARN WITH US
.NET Fundamentals
Categories
Case When Statement
(2)
CMD
(1)
Database Email
(1)
DatePart
(1)
Definitions
(37)
ERROR
(1)
Functions
(11)
INDEXING
(2)
LINQ
(1)
Search
(1)
Smo
(3)
Split Function
(2)
SSRS
(2)
System Stored Procedure
(4)
Transaction
(1)
Wildcard
(1)
XML
(3)
Blog Archive
►
2016
(8)
►
May
(2)
►
April
(2)
►
March
(2)
►
January
(2)
►
2015
(2)
►
December
(2)
►
2013
(3)
►
February
(3)
►
2012
(21)
►
October
(1)
►
July
(8)
►
June
(1)
►
May
(4)
►
April
(2)
►
February
(1)
►
January
(4)
►
2011
(5)
►
December
(2)
►
November
(2)
►
October
(1)
▼
2010
(18)
►
December
(1)
▼
October
(2)
Date Name
Get week date range from date
►
July
(3)
►
March
(5)
►
February
(2)
►
January
(5)
►
2009
(49)
►
December
(1)
►
May
(1)
►
April
(47)
Popular Posts
Handling special characters with FOR XML PATH('')
Issue: Length of LOB data to be replicated exceeds configured maximum 65536
SSRS Prompt for username and password in IE
Start with SMO
To generate insert statement for user defined tables available in SQL Server
No comments:
Post a Comment