Solved

SQL Reporting Services 2005 Create Report with YTD and LYTD information

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle connection in IDT Business objects problem 2 467
Calculating Day of the week - Cognos 10.2 2 107
SQL Report Builder Options 6 95
REPORT GENERATOR for CSV/Excel data 8 154
How to increase the row limit in Jasper Server.
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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