I’m creating a variable that has the following formula:
=ToDate(UserResponse([Marketing - Common Dimensions]; “Enter Termination Date (End):”); “MM/dd/yyyy”).
I’m trying to take the User Prompt response and converting it to a date so that I can use this field as part of another variable which will use the DaysBetween function.
When I place the variable in the report in its own cell, I keep getting #ERROR as the result.
Can someone tell me what is wrong with the formula. I am working on a SQL Server database.
I was having the same problem. rimpa’s solution worked and here is why:
The UserResponse function gives you back text. When it is a date it not only gives you the MM/dd/yyy it also gives you the hours, minutes seconds and AM or PM. Generally you will get 12:00:00 AM if there is no real time.
So in order to change this text of “11/13/2008 12:00:00 AM” into just 11/13/2008 you need to use this formula:
ToDate(UserResponse(“Enter Termination Date (End):”); “MM/dd/yyyy hh:mm:ss A”)
The key is using the full date/time format since that is what is in the text returned by the UserResponse function. If you don’t you just get an error.