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 - Script/Function to Find Last Day of Month

SQL SERVER – Script/Function to Find Last Day of Month

May 20, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Utility

A one line DATEADD query to find the last day of month for any date. It handles leap years: February 2008 gives the 29th and 2007 the 28th.

Read More
Function icon.

SQL SERVER – Math Functions Available in SQL Server

May 19, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server

One list of the Math Functions available in SQL Server, from ABS and CEILING to SQRT and TAN, and why RAND is the only nondeterministic one among them.

Read More
SQL SERVER - Fix: Error 130: Cannot perform an aggregate function on an expression containing an aggregate or a subquery

SQL SERVER – Fix: Error 130: Cannot perform an aggregate function on an expression containing an aggregate or a subquery

May 16, 2007
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Function, SQL Scripts, SQL Sub Query

Error 130 says you cannot perform an aggregate function on an expression containing an aggregate, like AVG(COUNT()). A derived table gets around it.

Read More
SQL SERVER - Binary Sequence Generator - Truth Table Generator

SQL SERVER – Binary Sequence Generator – Truth Table Generator

May 15, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Utility

A script that builds a 512 row truth table with its decimal value and binary sequence, using CROSS JOINs on a bit table. Add or remove joins to resize it.

Read More
A tear-off desk calendar with its first and last pages of the month held apart by two brass paperweights.

SQL SERVER – Query to Find First and Last Day of Current Month – Date Function

May 13, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server, SQL Utility

One query to find the First and Last Day of Current Month in SQL Server, plus the last day of the previous month and the first day of the next.

Read More
SQL SERVER - UDF - Function to Parse AlphaNumeric Characters from String

SQL SERVER – UDF – Function to Parse AlphaNumeric Characters from String

May 13, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

UDF_ParseAlphaChars keeps only the alphanumeric characters in a string and strips everything else using PATINDEX and STUFF. A handy function, with a test.

Read More
A hand lifting a perfect-looking wax lemon from a bowl of real lemons on a kitchen table.

REGEXP_LIKE in SQL Server 2025: Validating Codes, Emails and Phone Numbers

May 7, 2007
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Function, SQL Server, SQL String

Validate codes, email shapes and phone numbers with REGEXP_LIKE in SQL Server 2025, using clear patterns and CHECK constraints.

Read More
Previous 1 … 52 53 54 55 56 57 58 Next
  • Books
  • Testimonials
  • Privacy Policy

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