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
Gouache painting: three wooden shelves each hold the same three items: a large butternut squash for the year, a red apple for the month and a small blue plum for the day

CONVERT Date Styles: Use Explicit Numeric Formats

May 31, 2011
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Server

CONVERT date styles make date displays explicit. Keep the typed value for date logic and agree the output format with the receiving interface.

Read More
An orchard gate in early spring with a red ribbon tied to the post

Fiscal Years That Do Not Start in January

January 1, 2011
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Reports, SQL Scripts, SQL Server

Compute fiscal years and quarters from an April start, build indexed date boundaries, and store a fiscal calendar for repeatable reports.

Read More
SQL SERVER - Information Related to DATETIME and DATETIME2

SQL SERVER – Information Related to DATETIME and DATETIME2

November 15, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts

A reader comment explains the precision issue between DATETIME and DATETIME2: values lose precision when converted between types. Here is the workaround.

Read More
A garden kneeler with new side handles beside an old muddy folded sack, a red trowel on its pad

CURRENT_DATE, || and Other Small T-SQL Changes in SQL Server 2025

November 11, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Server, SQL String

Use CURRENT_DATE, string concatenation, optional SUBSTRING length and bigint DATEADD in SQL Server 2025 with clear examples and checks.

Read More
A row of bean jars on a shelf, one jar with a single extra red bean on top

Leap Years in T-SQL: February 29 and Date Math

November 5, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Handle leap years in T-SQL with date functions, test February boundaries, and choose a clear anniversary rule for February 29 births.

Read More
Gouache painting: two identical long dough logs lie parallel on a floured counter, each sliced into rounds of equal width

DATE_BUCKET: Align 15-Minute Windows With an Origin

October 21, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Server, SQL Server 2022

DATE_BUCKET uses an origin to align reporting windows. Keep width, unit and origin explicit while checking timestamps around each boundary.

Read More
Gouache painting: in a stone laundry room, two zinc washtubs stand side by side on a low bench

datetime2 Precision: Rounding Can Cross Midnight

October 16, 2010
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL DateTime, SQL Scripts

datetime2 precision changes can round into the next second or date. Compare typed seven-digit values with millisecond and whole-second conversions.

Read More
Previous 1 … 16 17 18 19 20 21 22 … 29 Next
  • Books
  • Testimonials
  • Privacy Policy

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