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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to view the report from 01/01/05 till end prev month 1

Status
Not open for further replies.

eo

MIS
Apr 3, 2003
809
Hi

I need to create a report, which will be run on a recurring basis using Enterprise for the period Start of the year untill the last day of the previous month.

So if they ran the report today, it would run for 01/01/2005 until 30/04/2005 (UK Date formats). The Start date is obvious, but what would a last day of the previous month formula look like?

EO
Hertfordshire, England
 
Try:

(
{table.date} >= cdate(year(currentdate),1,1)
and
{table.date} <= maximum(lastfullmonth)
)

There is a flawa in your logic, though, what if it's run on january 15th?

You say the starting date of the current year, to the maximum last full month, which would be 12/31/04...

So I'd adjust your logic to:

(
if month(currentdate) = 1 then
(
{table.date} >= cdate(year(currentdate),1,1)
and
{table.date} <= maximum(lastfullmonth)
)
else
(
{table.date} >= dateserial(year(currentdate)-1,1,1)
and
{table.date} <= maximum(lastfullmonth)
)
)

This would give you everything for last year.

-k
 
k,

Wouldn't the following work?

Code:
(
{table.date} >= cdate(year(minimum(LastFullMonth)),1,1)
and
{table.date} <= maximum(lastfullmonth)
)

-lw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top