Year-To-Date Query or Report

R

rwr

Does anyone have information on where I can find or how to do a YTD
query or report?

Thanks,

Ron
 
J

John W. Vinson

Does anyone have information on where I can find or how to do a YTD
query or report?

Right here:

Assuming that you have a date field in the table (if you don't you're in real
trouble! said:
= DateSerial(Year(Date()), 1, 1) AND < Date() + 1

Base a Report on this Query if you want a report.

John W. Vinson [MVP]
 
C

Chibby

Ron,
If you want to total information for specific years, try this:
1) Create a blank query and add your desired table/query.
2) In the first column type the following in the Field row
RonsTgtYear: Year([RonsDateField])
Note: "RonsTgtYear" becomes the name of the calculated field so name it
whatever you want. Replace "RonsDateField" with the field from the added
table/query that contains your date information.
3) Insert the fields that you want to sum up.
4) Select View>Totals to make the "Total:" row appear.
5) In the Total row ensure "Group By" is associated with the column created
in step 2.
6) Again in the Total row ensure "Sum" is associated with the fields you
want to sum up.
7) If you want to see only the information for a specific year, type that
year in Criteria under the column created in step 2.
8) If you want to see all the information without summing it up. Uncheck
the check next to View>Totals.

Hope this works for you Ron,
Cliff
 
J

John W. Vinson

Here's a rewrite, using temporal functionality (and easier to port to
other SQL products):

BETWEEN DATEADD('YYYY', DATEDIFF('YYYY', #1990-01-01 00:00:00#,
NOW()), #1990-01-01 00:00:00#)
AND DATEADD('D', DATEDIFF('D', #1990-01-01 00:00:00#, NOW()),
#1990-01-01 23:59:59#)

Jamie.

Are DateAdd and DateDiff any more portable than DateSerial? (not criticising,
just asking)

John W. Vinson [MVP]
 
R

rwr

rwr said:
Does anyone have information on where I can find or how to do a YTD
query or report?

Thanks,

Ron

Thanks to all replies. This really helps.

Thanks,
Ron
 
Top