reportbuilder - How to find the 1st day of a previosu month in SQL Server Reporting services -


i trying set default date fist day of previous april. have found expressions 1st day of previous month

=datevalue(dateadd("m",-1,dateadd("d",-(day(now)-1),now)))  

and have found expression 1st day of april current year (=cdate("04/01/"+cstr(year(now())) need find previous april, not april of current year.

is able please?

try:

=iif(today.month>=4,dateserial(today.year,4,1),dateserial(today.year-1,4,1)) 

note if run report in april or after current year april, if run report in march or before last year april.

let me know if helps.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -