• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 25
  • Last Modified:

SSRS - Set a parameter default date value to today at 6AM

Dear Experts:
I would like to set a date parameter default date value to today at 6AM.
e.g. 7/01/2018 6:00:00 AM
In other words I need the expression that can replace this expression that is not working:
=CDate(Format(Now(), "dd/MM/yyyy") + " 6 AM")

Note: I use SSRS 2016 and. I tried to run this report through the web service and fails with the invalid date error.
If I use expression =Today() then it works without any issue.
Miguel Oz
Miguel Oz
1 Solution
Nitin SontakkeDeveloperCommented:
Like several developers, I assume, you are confused between dates as understood by us humans and as understood by computers.

The best possible format to communicate dates with computers is yyyy-MM-dd HH:mm:ss.

Can you please modifying above as follows and give it a go?

=CDate(Format(Now(), "yyyy-MM-dd") + " 06:00:00")

On similar lines, you may also try format dd-MMM-yyyy HH:mm:ss

Hope it helps!
Miguel OzSoftware EngineerAuthor Commented:
Thank you it works OK, still the parameter format that comes out of the web service is US format but I can sort that issue out on the client side.

Join & Write a Comment

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now