Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Articles with tag Date Manipulation Rss

Search for any content tagged date manipulation

   Items 1 to 20 of 46    Older >>
 

Bones of SQL – Grouping By User-Defined Calendar Periods

Although it is common to group by periods such as Week, Month, or Quarter, sometimes alternative periods are needed. This simple technique lets you split a year into periods with any number of days.  Read more...
By Bob Hovious 2016/09/26 | Source: SQLServerCentral.com | Category: date manipulation
Rating: |  Discuss |   Briefcase | 1,180 reads

The Bones of SQL - The Holiday Table

This second part to a previous article on Calendar table generation shows how to create a holiday table containing both fixed-date and variable-date holidays.  Read more...
By Bob Hovious 2016/09/19 | Source: SQLServerCentral.com | Category: calendar
Rating: |  Discuss |   Briefcase | 1,853 reads

Bones of SQL - The Calendar Table

This article introduces the concept of the Calendar table to SQL newcomers and illustrates use of a few columns they might not have imagined.  Read more...
By Bob Hovious 2016/09/08 | Source: SQLServerCentral.com | Category: calendar
Rating: |  Discuss |   Briefcase | 3,647 reads

How to Get SQL Server Dates and Times Horribly Wrong

One of the times that you need things to go right is when you are doing analysis and reporting. This is generally based on time and date. A sure-fire way of getting managers upset is to get the figures horribly wrong by messing up the way that you handle datetime values in SQL Server. In the interests of peace, harmony and a long career in BI, Robert Sheldon outlines some of the worst mistakes you can make when using SQL Server dates.  Read more...
By Additional Articles 2015/06/08 | Source: SimpleTalk | Category: date manipulation
Rating:  Rate this |   Briefcase | 6,603 reads

Converting and Using Text Dates as SQL Server Dates

This tip describes some T-SQL techniques for converting a mmddyyyy string to a SQL Server date, handling rows with missing date strings, and comparing converted date strings.  Read more...
By Additional Articles 2015/05/28 | Source: MSSQLTips.com | Category: date manipulation
Rating: (not yet rated)  Rate this |   Briefcase | 7,269 reads

The SQL Server 2008 Datetimeoffset Data Type

The Datetimeoffset Data Type was introduced in SQL Server 2008 (and .Net Frameword 3.5) and is the most advanced date and time date type available.  Read more...
By James Skipwith 2014/03/28 (first published: 2011/04/18) | Source: SQLServerCentral.com | Category: sql server 2008
Rating: |  Discuss |   Briefcase | 13,389 reads

On Handling Dates in SQL

The handling of dates in TSQL is complex - when SQL Server was Sybase, it was forced by the lack of prevailing standards in SQL to create its own ways of processing and formatting dates and times. Joe Celko looks forward to a future when it is possible to write standard SQL date-processing code with SQL Server.  Read more...
By Additional Articles 2014/03/21 | Source: SimpleTalk | Category: date manipulation
Rating:  Rate this |   Briefcase | 6,914 reads

Calendar Tables II - The Anchor

Show the results for a date even if there is no data.  Read more...
By Todd Fifield 2014/02/21 (first published: 2010/08/16) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 15,295 reads

Calendar Tables

Learn how to avoid complex date calculations and increase performance using calendar tables in this article from Todd Fifield.  Read more...
By Todd Fifield 2014/02/14 (first published: 2010/07/15) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 39,687 reads

How to Compare Rows within Partitioned Sets to Find Overlapping Dates

How to Compare Rows within Partitioned Sets to Find Overlapping, Contiguous, or Gap dates  Read more...
By Kevin Wu 2013/12/25 (first published: 2010/10/11) | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 7,049 reads

Group Islands of Contiguous Dates (SQL Spackle)

Fill in another bit of your T-SQL knowledge by learning how to quickly group ranges of contiguous dates without RBAR.  Read more...
By Jeff Moden 2013/10/04 (first published: 2010/12/07) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 16,479 reads

Sorting Months By Number (SQL Spackle)

Fill in another bit of your T-SQL knowledge by learning how to sort a result set by the proper month order, but use the month name instead.  Read more...
By Jeff Moden 2013/08/02 (first published: 2010/11/15) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 18,127 reads

Formatting Dates with 3 Character Months (SQL Spackle)

Another in the series of articles to help you "fill in the cracks" in your T-SQL knowledge. MVP Jeff Moden shows us a super simple, high performance method to solve this timeless problem.  Read more...
By Jeff Moden 2013/07/19 (first published: 2011/01/20) | Source: SQLServerCentral.com | Category: formatting
Rating: |  Discuss |   Briefcase | 18,117 reads

SQL Server 2012: Time Marches On

Greg Larsen explores the new SQL Server 2012 date and time functions and shows you how to exploit these functions in new application code.  Read more...
By Additional Articles 2013/02/13 | Category: date manipulation
Rating: (not yet rated)  Rate this |   Briefcase | 3,356 reads

SQL Server Function to return a range of dates

A quick solution is a table function that will create a date range based on the parameters given. Then, you can just join to the results.  Read more...
By Additional Articles 2012/11/02 | Source: MSSQLTips.com | Category: date manipulation
Rating:  Rate this |   Briefcase | 4,666 reads

Dealing with custom date formats in T-SQL

Should I be formatting dates on the database side? What tools can I use in SQL Server to format and parse dates? This article helps you decide which one best suits your needs.  Read more...
By Gianluca Sartori 2012/03/23 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 8,019 reads

Calendar Tables

Learn how to avoid complex date calculations and increase performance using calendar tables in this article from Todd Fifield.  Read more...
By Todd Fifield 2014/02/14 (first published: 2010/07/15) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 39,687 reads

How to get monthly YTD data

This article presents an easy method to get YTD data grouped by months in T-SQL.  Read more...
By Kautuk 2012/01/24 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 11,326 reads

Using Recursion and Date Tables to Simplify Date Logic

Learn to simplify date logic using date tables and recursion in T-SQL with this article from David Beardsley.  Read more...
By David Beardsley 2011/12/13 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 9,926 reads

Need the First Tuesday Beyond Y days after X Date

A task was set before our team to find the first Tuesday after 10 days from a specific date. This article shows how we accomplished that.  Read more...
By Charles Martin 2011/10/13 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,516 reads
   Items 1 to 20 of 46    Older >>