Solved

SQL 2008 R2 to Excel

Posted on 2013-01-28
2
359 Views
Last Modified: 2013-02-22
I have a table in SQl 2008R2 like the following:

USE [IEOPC]
GO

/****** Object:  Table [dbo].[INSPECTION_v2]    Script Date: 01/28/2013 07:50:23 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[INSPECTION_v2](
      [DATE] [date] NULL,
      [APPLICANT] [varchar](max) NULL,
      [LOCATION] [varchar](max) NULL,
      [REMARKS] [varchar](max) NULL,
      [QUANTITY] [numeric](18, 0) NULL,
      [COUNT] [numeric](18, 0) NULL,
      [CONTAINER] [varchar](max) NULL,
      [GRADE] [varchar](50) NULL,
      [CERTIFICATE NUMBER] [numeric](18, 0) NULL,
      [CAR NUMBER] [numeric](18, 0) NULL,
      [QUANTITY THOUSAND WEIGHT]  AS ([QUANTITY]*[COUNT]),
      [TIME INSPECTION BEGUN] [time](0) NULL,
      [TIME INSPECTION COMPLETED] [time](0) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

And data like the attached spread sheet.

The tab called database is the data that populates the table mentioned above.

I need to be able to input a date range in the tab called Input and then have the tab called LIGP and EOPC add the certificates associated with their company names together for each day in the date range and add them to the correct columns in the tab.

For example:

You will see that LIGP has 12 line items for 10-1-2012 from certificate 73496 totaling 744,372.

I would need all the certificates for 10-1-2012 added together and put the date, Certificate and weight in the appropriate columns.  Also the weight column needs to be divided by 100 as the weight column is hundred weight.

This would need to be done for each certificate and each applicant in the provided date range.

Where would I start with this??

Thanks!!
0
Comment
Question by:HDM
[X]
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 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 500 total points
ID: 38827889
0
 

Author Comment

by:HDM
ID: 38828789
I know how to export the data to excel.

What I dont know is how to set the "Date Range tab" so the query will reflect the date I type in the space there.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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 Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

696 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