SQL DATE Functions

Transact-SQL (TSQL) Quick Tips – SQL DATE Functions In the following post, I demonstrate a collection of common SQL DATE Functions I use on a regular basis.  I encourage you to copy this code into your Query Window, then EXECUTE as-is.  The code includes a #temp table with data to illustrate the functionality.  You can modify to suit your needs. … Read more

SQL CHARINDEX

Transact-SQL (TSQL) Quick Tips – SQL CHARINDEX Function Here is a simple example of how the SQL CHARINDEX function works.  You can copy this code into your Query Window and EXECUTE as-is.  The code includes a #temp table with data to illustrate the functionality.  You can modify to suit your needs. The SQL CHARINDEX function searches … Read more

SQL REPLACE

Transact-SQL (TSQL) Quick Tips – SQL REPLACE Function The following post contains a simple example of the SQL REPLACE function.  I encourage you to copy the code provided below, then paste the code into your Query Window and EXECUTE as-is.  If you execute the code yourself, you will better understand how the SQL REPLACE function works.  The code includes a temp table with data to … Read more

SQL ROW_NUMBER

The following code snippet will identify the MAX value on a given dimension(s), based on the value of a specified field.  This works well if you are trying to determine which value of a given dimension that you would like to display, if there are multiple options. By Definition:  Returns the sequential number of a … Read more