SquaredUp logo
  • Product
    • Community Edition
      Dashboard any data for free
    • Azure Edition
      Take control of Azure costs and performance
    • SCOM Edition
      Unlock insights from Microsoft SCOM
    • Compare Editions
    • Integrations
      Bring together data from anywhere
    • Dashboard Gallery
      Find inspiration and real-life dashboard use cases
  • Pricing
  • Resources
    • Blog
      Discover tips, tricks, news, and more
    • Learn
      Master SCOM and Azure Monitor with help from our experts
    • Webinars and Events
      Sign up for the next event or watch a replay on-demand
    • Downloads
      Download the latest releases, tools, scripts, and more
    • Datasheets
      Get concise SquaredUp overviews to share with the team
    • SCOMathon
      The hub for all things SCOM
  • Support
    • Support Portal
      Search for answers or submit a request to our experts
    • Community Answers
      Connect with a community of experts to ask questions and find answers
  • Company
    • Company
      Find out more about SquaredUp’s vision, people, and values
    • Careers
      Join our growing team – we’re hiring!
    • Customers
      Learn how our customers are taming complex IT landscapes
  • Download now
  • Dashboard Fridays
  • SQL
  • Grid / Table
  • Business
  • Database
  • IT
Dashboard Gallery

SQL Page Timeframe

This SQL Page Timeframe dashboard demonstrates how the current date and time are displayed, along with an example utilizing the Page Timeframe feature of SquaredUp.

Shawn Williams , SquaredUp
How do I get it?

Challenge

When writing a SQL query, getting the date and time to format correctly can be a real pain.  What is the current date and time, and how is it formatted?  What happens if I want the date and time from 30 days ago?  Is there a dashboard that demonstrates how to manipulate date and time for SQL Queries?

Solution

This SQL Page Timeframe dashboard demonstrates how the current date is picked up from the server hosting SquaredUp and how the Page Timeframe button impacts the date and time in a SQL query. Several different examples are demonstrated.

Dashboard walk-through

Each time on the dashboard does something different with the Date and Time.  Here is how it breaks down:

  1. Tile 1 (SQL Native) – A simple query that uses the Current_Timestamp function but formats the date and time in a specific way.
  2. Tile 2 (Page Time Frame) – A Case statement the demonstrates how the Page Timeframe is passed into a SquaredUp tile.
  3. Tile 3 (Current Time with Time Zone) – A Select query utilizing the SysDateTimeOffset function and formats the Date and Time with the time zone.  The formatting used is different from the formatting used in Tile #1.
  4. Tile 4 (Time zone of the server) – The Time Zone of the server hosting SquaredUp.  This information is essential to note when working with a server in a different time zone.
  5. Tile 5 (SQL GetDate Function) – A cornucopia of Date and Time values formatted for each Page Timeframe selection.  These are hardcoded so that for comparison purposes with Tile #6.
  6. Tile 6 (Page Time Frame) – Demonstrates how to use the dynamic page timeframe feature.  Plus, it includes some date manipulation to change how you want the starting date.  For example, start at midnight of the target day, or target the same time as now.

How do I import and configure this dashboard

  1. Ensure you’re using Dashboard Server v5.4 or above.

    Already a SquaredUp customer?

    Get the latest version of SCOM Edition

    New to SquaredUp?

    Try it for free

  2. Download and import this dashboard pack.

    ClosedHow to import a dashboard pack
    1. Download the dashboard pack zip file for the dashboard pack you wish to import.

      There may be additional steps before or after the import to get the dashboard working in your environment.

    2. In SCOM Edition go to the top right hand menu ☰ > Import Dashboard Packs and drag the zip file into the Manual Import box.

       

    3. The dashboard pack is imported and if the pack contains top-level dashboards, these will automatically appear in the navigation bar, usually in a folder called ‘Community Dashboards’ for dashboard packs from the SquaredUp Community. If the dashboard pack also contains perspectives (see Working with perspectives), then you’ll see these when you drilldown to the relevant object.

    4. Carry out any additional steps required to make the dashboard work in your environment. These steps will be described on the download page for each dashboard. For example, you may need to create the correctly named Web API provider, create a PowerShell profile, or edit tile scopes.

    5. Edit the imported dashboard as required.

    Download zip for SquaredUp Azure Edition
    Download zip for SquaredUp SCOM Edition
    Download zip for SquaredUp Community Edition
  3. Replace the connection string in each of the seven SQL tiles with the connection string to your own OperationsManagerDW database.

    Note: This dashboard requires a connection to SQL Server, but any database can be used. To make things simpler, the Master database was chosen, but the target database can be changed as needed.

    1. Edit the tiles by clicking the Edit button.

    2. Open the connection panel.

    3. Enter the connection string global:dw.

  4. Publish the dashboard.

    ClosedHow to publish a dashboard

    A newly created dashboard will not be visible to others until you publish it. If you made changes to an existing dashboard, the changes will only be visible to others after you published the dashboard again.

    You can identify a dashboard that has not been published yet or has unpublished changes by the unpublished button at the top:

    When you click on the unpublished button, you’ll have two options:

    • Publish will make the dashboard or changes visible to others.
      Note: A newly created dashboard will appear on the menu where you created it. To move the dashboard to a different place on the navigation bar see How to edit the Navigation Bar.

    • Discard will delete your draft dashboard if it has never been published or, if you made changes to an already published dashboard, discard the changes.

    Publishing dashboards to different audiences

    Find out how to publish dashboards to a subset of users using Team Folders or visible to anyone even unlicensed users with Open Access (Sharing Dashboards with anyone – Open Access).

 

GET STARTED TODAY

Zero to dashboard hero in 60 seconds

Start now with hundreds of customizable dashboards.

  • Sites
    • Support
    • Download
    • Community Answers
  • Quick Links
    • Webinars and Events
    • About Us
    • Careers
  • Small print
    • Privacy Policy
    • Terms and Conditions
    • Staying COVID-19 Secure
UKAPR 2022-APR 2023

© SquaredUp 2022