Solved

SQL Reporting Services 2005 Create Report with YTD and LYTD information

Posted on 2006-07-01
2
1,135 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

I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
How to increase the row limit in Jasper Server.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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