all groups > sql server reporting services > march 2006 >
You're in the

sql server reporting services

group:

Report parameter - First day of last month/last day of month


Report parameter - First day of last month/last day of month Martin
3/20/2006 4:17:27 PM
sql server reporting services:
can somebody pls. help me with the following report parameter defaults?

for a monthly report I need two dates as parameter defaults:

The first day of the last month
and
the last day of last month

If I run a report on - let's say March 1st, I can get the last day of the
last month with
=Today.AddDays(-1)
and the first day of the last month with
=Today.AddMonths(-1)

However, I need these paramers to work every day. For example, I want to be
able to run the report on March 3rd or March 15th, and the report should also
have February 1st and February 28th as start and end dates.

How can I do this?

Thank you for helping,

Martin
RE: Report parameter - First day of last month/last day of month Amarnath
3/21/2006 1:17:26 AM
Hi Martin,
This will work everyday. start and end date of last month.

start date - str(year(today)) + "/" + str(month(today)-1) + "/1"
End Date - dateadd("d",-1, (str(year(today)) + "/" + str(month(today)) +
"/1"))

Now the date format ie dd/mm/yy or mm/dd/yy etc... I hope you can change it.

Amarnath


[quoted text, click to view]
AddThis Social Bookmark Button