Skip to main content

Time Range Calculations and Trends

  • Chapter
  • First Online:
Expert T-SQL Window Functions in SQL Server
  • 1300 Accesses

Abstract

A common reporting requirement is to produce totals by different ranges of time for comparison. Typical reports contain totals by month, quarter, and year, sometimes with comparisons to the same period in the prior year or for month-to-date or year-to-date totals. Products like SQL Server Analysis Services and PowerPivot provide functions to navigate date hierarchies. With window functions in SQL Server 2012 or later, you can produce the same calculations using the techniques provided earlier in this book.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 19.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Kathi Kellenberger with Clayton Groom

About this chapter

Cite this chapter

Kellenberger, K., Groom, C. (2015). Time Range Calculations and Trends. In: Expert T-SQL Window Functions in SQL Server. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1103-8_9

Download citation

Publish with us

Policies and ethics