YTD previous year

J

jms02360

Hello,
Im trying to get the prevous YTD to work. The current year to date
works fine.
Projects: Sum(IIf([StartDate] Between
[Forms]![frmRptDateRange/Note].[BeginDate]
And [Forms]![frmRptDateRange/Note].[EndDate],1,0))

Here's the expression for the previous year.
Projects_LY: Sum(IIf([StartDate] Between
DateSerial(Year([Forms]![frmRptDateRange/Note].[BeginDate])
-1,Month([Forms]![frmRptDateRange/Note].[BeginDate]),Day([Forms]![frmRptDateRange/Note].[BeginDate]))

And
DateSerial(Year([Forms]![frmRptDateRange/Note].[EndDate])-1,Month([Forms]![frmRptDateRange/Note].
[EndDate]),Day([Forms]![frmRptDateRange/Note].[EndDate]))
And Year([StartDate])=Year(Date())-1,1,0))

Both have a criteria of >0.

Thanks
 
G

Guest

Try:

SELECT Format$([date],'yyyy') AS [Year]
FROM yourtable
WHERE (((Format$([date],'yyyy'))=Year(Now())-1));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top