powered by Devart
  • Products
    Platform

    Integrate, back up, access, and manage your cloud data with our all-in-one cloud service

    Overview
    Platform

    Integrate, back up, access, and manage your cloud data with our all-in-one cloud service

    Data Integration

    Integrate your data quickly and easily with no coding

    Automation

    Automate business processes and data flows between cloud apps and databases

    Connect

    Connect various data sources with different data-related applications

    Query

    Query your data from web browser via visual query builder or SQL

    Backup

    Keep your data safe with automatic daily and anytime manual backups

    Looker Studio connector

    Connect to any cloud source or database directly from Looker Studio.

  • Solutions
    Solutions

    Data integration, data access, cloud to cloud backup and management.

    Overview
    By use case
    Data ImportData ExportData SynchronizationData ReplicationData WarehousingData AnalysisMarketing AnalyticsOn-premise Data Integration
    By Protocol
    SQLODBCODataADO.NETMCP
    By app
    SalesforceLooker StudioGoogle SheetsExcel
  • Connectors
  • Pricing
  • Resources
    • Blog
    • Case Studies
    • Webinars
    • Whitepapers
    • Gallery
    • Compare ETL Tools
    • Learn
    • Support Center
    • Documentation
  • Company
    • About Us
    • Contacts
    • Partners
Request a CallSign InSign Up
  • Home
  • Gallery
  • Salesforce sales report by accounts by quarters

Salesforce sales report by accounts by quarters

Query · SQL
Run this query
  SELECT a."Name" 'Account Name', 
        SUM(case when (o."FiscalQuarter"=1 and o."FiscalYear"=strftime('%Y','now')) then o."Amount" else 0 end) 'Q1 Amount',
        SUM(case when (o."FiscalQuarter"=2 and o."FiscalYear"=strftime('%Y','now')) then o."Amount" else 0 end) 'Q2 Amount',
        SUM(case when (o."FiscalQuarter"=3 and o."FiscalYear"=strftime('%Y','now')) then o."Amount" else 0 end) 'Q3 Amount',
        SUM(case when (o."FiscalQuarter"=4 and o."FiscalYear"=strftime('%Y','now')) then o."Amount" else 0 end) 'Q4 Amount',
        SUM(case when (o."FiscalYear"=strftime('%Y','now')) then o."Amount" else 0 end) 'Q1-Q4 Amount SUM'
  FROM "Opportunity" o, "Account" a
  WHERE o."IsWon"=true AND
        o."IsClosed"=true AND
        o."AccountId"= a."Id"
  GROUP BY o."AccountId"
  ORDER BY SUM(o."Amount") DESC

Learn how to export Salesforce sales report by accounts by quarters using Skyvia Query - online SQL query builder

No limits

Run This and Other Queries Online in Skyvia Query

Skyvia Query allows you to run SQL queries against databases and cloud applications from web browser. Access and manage your data from anywhere, build reports, arrange your data in the most informative way and simplify your decision-making process easily!

Go to Skyvia Query

Key Features

  • Ability to use SQL against cloud data
  • Visual query builder
  • Data export
  • Five free queries per day
Learn more about Skyvia Query
FAQ

Frequently Asked Questions

What can I use gallery queries for?

Our pre-built queries helps you quickly analyze and report on your data without building a query from scratch or perform DML operations and mass data updates.

Which data sources can I run queries on?

Skyvia Query supports cloud apps, databases, and other connected data sources available in Skyvia.

Can I get query results to a spreadsheet?

Yes. You can use Skyvia Query Google Sheets Add-on or Excel Add-in to query data directly to your workbooks. Alternatively, you can export the results of any query to CSV.

Do I need advanced SQL knowledge to use prebuilt queries?

No. Prebuilt queries can be used as ready-made examples and adjusted if needed.

Get Results Faster with Skyvia Query

Run this queryBook a live demo
Company
  • About Us
  • Contacts
  • Partners
Platform
  • Data Integration
  • Query
  • Connectors
  • Backup
  • Connect
  • Looker Studio Connector
  • Pricing
Solutions
  • Data Import
  • Data Export
  • Data Synchronization
  • Data Replication
  • Data Warehousing
  • On-Premise Data Integration
  • Data Analysis
  • Salesforce Data Loader
  • Salesforce Connect Integration
  • SQL for Cloud Apps
Resources
  • Blog
  • Case Studies
  • Gallery
  • Compare ETL Tools
  • Learn
  • Support Center
  • Documentation
  • © Skyvia, 2014–2026. All rights reserved
  • Terms of Service
  • Security
  • Privacy Policy
  • support@skyvia.com
  • support@skyvia.com
  • © Skyvia, 2014–2026. All rights reserved