SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Scripts with tag Date Rss

Search for any content tagged date

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Add a script

   Items 1 to 12 of 12   


Generates # of dates in before/after current year. No more hardcoded date ranges.  Read more...
By Mitch Spruill 2016/08/08 | Source: SQLServerCentral.com | Category: dynamic
Rating: |  Discuss |   Briefcase | 555 reads

Calculate Age (in years)

An inline table valued function (iTVF) that can be used to calculate age in years.  Read more...
By Alan Burstein 2016/04/27 | Source: SQLServerCentral.com | Category: date
Rating: |  Discuss |   Briefcase | 897 reads

Calendar Table Function

This iTVF will produce a calendar table that can be used for complex date manipulation; quickly and effeciently  Read more...
By Chris Kutsch 2016/08/02 | Source: SQLServerCentral.com | Category: calendar
Rating: |  Discuss |   Briefcase | 4,591 reads

Checking All Date Columns in a Table(s)

Find minimum and maximum values for all date columns in a table or range of tables, using a mask.  Read more...
By Larry Schmidt 2016/09/15 | Source: SQLServerCentral.com | Category: date
Rating: |  Discuss |   Briefcase | 2,396 reads

PivotByDate clr stored procedure

This script pivots 1 to N numeric columns, grouping by 1 to N (N)(Var)char columns, pivoting by distinct date.  Read more...
By Louis Nardozi 2013/10/30 | Source: SQLServerCentral.com | Category: pivot
Rating: (not yet rated) |  Discuss |   Briefcase | 1,054 reads

Function to format a datetime variable by a mask

I have used the following function to convert dates according to desired textual formats that were not immediately available in the standard styles on offer.  Read more...
By Colin Frame 2013/10/18 | Source: SQLServerCentral.com | Category: datetime
Rating: |  Discuss |   Briefcase | 1,635 reads

Date Format

Returns your date in the format mask you require.  Read more...
By Ervin Santiago 2013/03/11 | Source: SQLServerCentral.com | Category: date
Rating: |  Discuss |   Briefcase | 2,027 reads

Calculate U.S. Holidays

This script runs off the Date Calendar table to flag is_workday when your business is closed for holiday.  Read more...
By Boyd Tyrrell 2011/07/01 | Source: SQLServerCentral.com | Category: holiday
Rating: |  Discuss |   Briefcase | 2,858 reads

Convert seconds to a timestring

This script converts a number of seconds (integer) to a time string, format 'hh:mm:ss'  Read more...
By Wilfred van Dijk 2010/05/05 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,390 reads

Date Calendar

Code to create a handy date calendar cross-reference table with a ton of pre-populated, slice-and-dice data field variations to aid in complex date parameterization / selection criteria.  Read more...
By Sean Smith 2018/04/26 | Source: SQLServerCentral.com | Category: date
Rating: |  Discuss |   Briefcase | 11,194 reads

Return X Day of Month

This function will return the first, second, third, fourth or last day of a given month.  Read more...
By Justin Wagner 2009/03/03 | Source: SQLServerCentral.com | Category: date
Rating: |  Discuss |   Briefcase | 1,137 reads

Function to Return Date and Time String for File Archiving

This function will return a string in sortable format YYYYMMDD-hhmmssnnn to append to file names for archiving.  Read more...
By Joshua A. Walker 2009/02/18 | Source: SQLServerCentral.com | Category: miscellaneous
Rating: |  Discuss |   Briefcase | 1,416 reads
   Items 1 to 12 of 12