Solved

how to retreive data according to date constrain

Posted on 2014-09-03
5
133 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Viewers will learn how the fundamental information of how to create a table.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 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