SELECT
DATEADD(day,DATEDIFF(day,'19000107',DATEADD(month,DATEDIFF(MONTH,0,GETDATE() /*YourValuehere*/),30))/7*7,'19000107')
Edit: A correct, final, working answer from my colleague.
More Related Contents:
- How to Join to first row
- Pivot using SQL Server 2000
- SQL where clause odd behavior [closed]
- How do I obtain a Query Execution Plan in SQL Server?
- How do I escape a single quote in SQL Server?
- Simple way to transpose columns and rows in SQL?
- Only inserting a row if it’s not already there
- Unpivot with column name
- Selecting data from two different servers in SQL Server
- Maximum size for a SQL Server Query? IN clause? Is there a Better Approach [duplicate]
- SQL JOIN vs IN performance?
- Most efficient way in SQL Server to get date from date+time?
- Convert varchar into datetime in SQL Server
- TSQL Pivot without aggregate function
- How to generate a range of dates in SQL Server
- SQL RANK() versus ROW_NUMBER()
- How to rewrite IS DISTINCT FROM and IS NOT DISTINCT FROM in SQL Server 20008R2?
- How do I delete from multiple tables using INNER JOIN in SQL server
- Check if a row exists, otherwise insert
- SQL : BETWEEN vs =
- Drop all the tables, stored procedures, triggers, constraints and all the dependencies in one sql statement
- How do I perform a GROUP BY on an aliased column in SQL Server?
- How do I make a composite key with SQL Server Management Studio?
- Script to kill all connections to a database (More than RESTRICTED_USER ROLLBACK)
- TransactSQL to run another TransactSQL script
- How can I generate a temporary table filled with dates in SQL Server 2000?
- Getting Dates between a range of dates
- WHERE IS NULL, IS NOT NULL or NO WHERE clause depending on SQL Server parameter value
- SUM total time in SQL Server [duplicate]
- When to use EXCEPT as opposed to NOT EXISTS in Transact SQL?