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

Last Day in the month Parameter

Status
Not open for further replies.

maas

Programmer
Sep 3, 2009
148
BH
Hello All,

I am having a problem while changing this process from a manual parameter to an automatic parameter.

The problem is that the user is passing "30-june-2010" or any date in june for the report and there is one subreport which is getting the last day in the previous month. So, the user has to input "31-5-2010". So, instead of prompting the user to input "31-5-2010", can a formula be done to get this value from the passed date which is "30-june-2010".

Thanks
 
{table.date} in dateserial(year({?Date}), month({?Date})-1,1) to dateserial(year({?Date}), month({?Date}),1)-1

Link the {?Date} to {?Date} using the dropdown in the lower left of the subreport linking screen. Then modify the selection formula of the subreport to match the above.

-LB
 
lbaas, I tried but it returned a false statement.

If I want to make it in a direct way, I should do it in this way:

{table.date} in dateserial(year({table.date} ), month({table.date} )-1,1) to dateserial(year({table.date} ), month({table.date} ),1)-1
 
My suggestion was for a record selection formula that would return data from the last full month prior to the parameter date. I assumed that the subreport was linked to the main report on the parameter {?Date}, i.e., that you had created the same parameter in the subreport, used the selection formula I provided in the subreport, and linked the parameters to each other.

Your formula would not return any data, since it says to show the record if the date in the record is in the month previous to the month in the record--logically impossible.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top