Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Full Month and Year to Date

Status
Not open for further replies.

plextor

IS-IT--Management
Jan 7, 2003
34
US
I'm trying to create a formula where it selects the last full month and year to date. Any Ideas?

Thanks A lot,
Brian
 
A formula to do what, count something, limit the rows in the report, or?

The syntax:

{table.date} in lastfullmonth

and

{table.date} in yeartodate

You couldn't have been much closer to the syntax in your question ;)

-k
 
Sorry i should of gave more detail in my original post....

I have a graph thats grouped by month's. What I'm trying to do is only select the last full month of data and the last 12 months... So far, I tried.

{table.date} in lastfullmonth
and
{table.date} in yeartodate

For some reason this formula is only selecting the last full month and not including the year to date date.

Thanks again,
Brian

 
Replace {table.date} with your table date field...

select Report->Edit Selection Formula and place:

{table.date} in lastfullmonth
OR
{table.date}

BTW, year to date will usually encompass the last full month, just not in January.

-k
 
Replace {table.date} with your table date field...

select Report->Edit Selection Formula and place:

{table.date} in lastfullmonth
OR
{table.date} in yeartodate

BTW, year to date will usually encompass the last full month, just not in January.

-k
 
It does the opposite of the origianl formula. It selects the last full year but includes the current month.... Heres the formala

{mApplicationStat.Timestamp} in lastfullmonth

or

{mApplicationStat.Timestamp} in yeartodate


Brian
 
I, too, create reports based on the last rolling 12 months

{table.date} in [dateserial(year(currentdate)-1,month(currentdate)-1,1) to_ dateserial(year(currentdate),month(currentdate),1)]
 
That did the job....... Thank you very much.
 
Year to date will always include the current month, hence the words "to date". You never stated that you didn't want the current month.

What you wanted was the last full 12 months.

Good to know that it's resolved.

-k
 
Ooops! Need to change that formula slightly. What I gave you will not work in January and reporting for December.

Leaving the current year alone and subtracting 12 from the month will adjust the year accordingly.

{table.date} in [dateserial(year(currentdate),month(currentdate)-12,1) to_ dateserial(year(currentdate),month(currentdate),1)]

Cheers,

WichitaKid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top