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
Wall covered with many vintage clocks showing different times

SQL SERVER – UDF – Function to Get Previous And Next Work Day – Exclude Saturday and Sunday

July 23, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Inspired by a ColdFusion post by Ben Nadel, here is the UDF I use to get the previous or Next Work Day for any date, skipping Saturday and Sunday.

Read More
SQL SERVER - UDF - Get the Day of the Week Function

SQL SERVER – UDF – Get the Day of the Week Function

July 23, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Utility

Get the day of the week as a name in SQL Server: a UDF using DATEPART with CASE, plus the simpler DATENAME(dw, GETDATE()) a reader suggested.

Read More
SQL SERVER - SPACE Function Example

SQL SERVER – SPACE Function Example

July 19, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

Does SQL Server have a SPACE function? Yes. SELECT SPACE(100) returns 100 spaces, and a short example uses it to join last and first names.

Read More
SQL SERVER - CASE Statement in ORDER BY Clause - ORDER BY using Variable

SQL SERVER – CASE Statement in ORDER BY Clause – ORDER BY using Variable

July 17, 2007
Pinal Dave
SQL Performance
SQL Function, SQL Scripts

Stop building ORDER BY strings and running them with EXEC in a stored procedure. I show how a CASE statement in ORDER BY sorts by a variable without dynamic SQL.

Read More
Gouache painting: on a laundry table, two wool sweaters lie side by side, the same cream color, each with the same vermilion loop at the collar

CHECKSUM: A Matching Result Does Not Prove Text Identity

July 16, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server

CHECKSUM matches do not establish unchanged text. Preserve complete values and compare hyphen and trailing-space differences explicitly.

Read More
ISDATE function in SQL Server.

SQL SERVER – Validate Field For DATE datatype using function ISDATE()

July 12, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

A CSV import crashed on the date 30/2/2007. Use the ISDATE() function to validate a VARCHAR column in a staging table before moving rows to a DATETIME field.

Read More
A plain pale wooden block with a square opening beside a larger vermilion cube.

TRY_CONVERT Integer Validation: Check the Target Type

July 11, 2007
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL NULL, SQL Server

TRY_CONVERT integer validation starts with the destination type and a separate input policy. This example compares blank, signed, decimal and overflowing text without writing data.

Read More
Previous 1 … 80 81 82 83 84 85 86 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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