Solved

how to retreive data according to date constrain

Posted on 2014-09-03
5
132 Views
Last Modified: 2014-09-05
I am connecting Excel to SQL Server to create some reports by using the data from SQL.. Example of data in SQL is Table name: Campaign that include (AccountID, date, impressions, clicks, cost). I would like to create a report in Excel that keep historical record for each week just like the one in the picture how i want my report to look like.. is there any way that allow me to pull data from SQL in weekly bases ?

Thank you!
0
Comment
Question by:Rawan Jambi
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:jkpieterse
ID: 40301185
Click the Data tab of the ribbon, click "From other sources", "from SQL server" and off you go!
0
 

Author Comment

by:Rawan Jambi
ID: 40301220
yes I know I am doing this already.. my question is when getting the data how can I make them come as blocks for weeks? for example (1 july - 7 july ) with their data (accounted, impressions, clicks and cost) then (8 july - 15 july) then the next week ... etc
0
 
LVL 11

Expert Comment

by:jkpieterse
ID: 40301257
You would typically create a pivottable off of the data, drag the date field in the row area and then group that date field.
0
 
LVL 16

Accepted Solution

by:
Jerry Paladino earned 500 total points
ID: 40303597
Use your detail data to generate a pivot table.   Insert / Pivot Table...   Group the Date field... right mouse click on that field and select GROUP.   For Weeks, select Day and choose 7 in the number of days box.   Use "Calculated Fields" for Cost per Click and Click Through Rate.  Pivot Table / Analyze / Calculations group / Fields, Items, & Sets.  See graphics below.   A sample excel file is attached. GroupingGroup by WeekCalculated Field Dialog selectionCalculated Field - Cost per ClickCalculated Field - Click Through RatePivot-Table--Group-by-Week.xlsx
0
 

Author Comment

by:Rawan Jambi
ID: 40305603
Thank you so much that was very helpful.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question