Solved

SQL Reporting Services 2005 Create Report with YTD and LYTD information

Posted on 2006-07-01
2
1,136 Views
Last Modified: 2012-06-27
Hi,

I'm trying to create a tabular report that returns a YTD and LYTD totals for a check register.

The table contains the following fields:

Customer
DateEntered
Amount
Type

I'm new at this - any help is appreciated.

Thanks,

Terry

0
Comment
Question by:tmccull2
[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 4

Accepted Solution

by:
dnsvh earned 250 total points
ID: 17062488
Using MS SQL, your SQL statement would look like this:

SELECT
Customer,
DateEntered,
YEAR(DateEntered) 'EnteredYear',
Amount,
Type
FROM dbo.YourTable
--Display LYTD
WHERE (DateEntered BETWEEN CONVERT(DATETIME, CONVERT(CHAR(4), YEAR(GETDATE()) - 1) + '-01-01') AND DATEADD(YEAR, -1, GETDATE()))
--Display YTD
OR YEAR(DateEntered) = YEAR(GETDATE())

You could then create a table, group on year and do your totals that way.  Does this make sense?

Derrick
0
 

Author Comment

by:tmccull2
ID: 17080453
Derrick,

Makes sense - thank you.

Terry
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

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

734 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