This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
SQL Server Management Studio query window with SQL code.

SQL SERVER – List the Name of the Months Between Date Ranges

December 9, 2014
Pinal Dave
SQL Tips and Tricks
SQL DateTime

How do you list the name of the months between date ranges? A friend and former co-worker sent me this script using DATENAME and DATEADD.

Read More
Odd week is highlighted.

SQL SERVER – Finding if Current Week is Odd or Even – Script

December 7, 2014
Pinal Dave
SQL Tips and Tricks
SQL DateTime

A bank DBA needed a script to tell if the current week is odd or even, to keep more cash on the 2nd and 4th weeks. Here is the script I use.

Read More
SQL SERVER - Convert Seconds to Hour : Minute : Seconds Format

SQL SERVER – Convert Seconds to Hour : Minute : Seconds Format

August 17, 2014
Pinal Dave
SQL Tips and Tricks
SQL DateTime

A reader needed to convert seconds to Hour : Minute : Seconds format for a web page report. Here is a simple T-SQL script that does it.

Read More
SQL SERVER - Validating If Date is Last Day of the Year, Month or Day

SQL SERVER – Validating If Date is Last Day of the Year, Month or Day

August 15, 2014
Pinal Dave
SQL Tips and Tricks
SQL DateTime

A reader asked how to check if a date is the last day of the year, month or week. There is no built-in function, so here is the one I wrote.

Read More
Script to find first day of current month.

SQL SERVER – Script to Find First Day of Current Month

August 14, 2014
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function

Michael Usov suggested a quick way to find the first day of current month while keeping the DATETIME datatype, with or without the time part.

Read More
MySQL - How to Format Date in MySQL with DATE_FORMAT()

MySQL – How to Format Date in MySQL with DATE_FORMAT()

July 19, 2014
Pinal Dave
SQL Tips and Tricks
MySQL, SQL DateTime

MySQL uses the DATE_FORMAT function to show a date or datetime value in the format you need. Here are simple, self-explanatory examples for common formats.

Read More
MySQL - Finding First day and Last day of a Month

MySQL – Finding First day and Last day of a Month

April 9, 2014
Pinal Dave
SQL Tips and Tricks
MySQL, SQL DateTime

MySQL has LAST_DAY to find the last day of a month but nothing built in for the first day. I show two simple methods to find the first day as well.

Read More
Previous 1 … 7 8 9 10 11 12 13 … 19 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com