15

When I set a default value formula for a date parameter in SSRS, such as:

=CDate(”01/” & Month(Now) & “/” & Year(Now))

or even:

=Now

the date parameter control becomes disabled with nothing in it. Does anyone know what simple thing (I am sure) I am doing wrong?

THelper
  • 15,333
  • 6
  • 64
  • 104
CodeGrue
  • 5,865
  • 6
  • 44
  • 62

3 Answers3

26

After playing some more, I realized that the date controls became enabled when I picked a value from a preceding dropdown parameter that did not have a default. Apparently, controls after non-default parameters are disabled until you pick something, so order matters.

From an MDSN article:

"parameter order is important when you want to show users the default value for one parameter before they choose values for other parameters"

http://msdn.microsoft.com/en-us/library/cc281392.aspx

CodeGrue
  • 5,865
  • 6
  • 44
  • 62
  • 3
    That was a really nasty thing! Just disabling controls without any messages or warnings is a horrible thing to do. Shame on Microsoft. Thanks for the good catch and helping me fix my blasted report. – ErikE Dec 23 '10 at 21:01
  • That's bad bad bad. Just started Reporting Services and thats not giving a good impression. I wonder how many other "rules" there we are supposed to magically know about? – Steve Ward Sep 13 '11 at 00:36
0

I experienced the same and the problems lies on the USER ID parameter that I set to internal visibility but without any default value. When I put in default value or set this to null, the date parameter was enabled.. (User ID parameter comes before the date parameter on my case)

-3

Now is a function and you must use like =Now()

maybe it is your problem.

masoud ramezani
  • 22,228
  • 29
  • 98
  • 151