Solved

SQL Reporting Services 2005 Create Report with YTD and LYTD information

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now