how to retreive data according to date constrain

Posted on 2014-09-03
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!
Question by:Rawan Jambi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 11

Expert Comment

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

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
LVL 11

Expert Comment

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.
LVL 16

Accepted Solution

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

Author Comment

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

Featured Post

Technology Partners: 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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

628 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