system
July 15, 2004, 7:00pm
1
Hello I am trying to capture the date from a date prompt, but the following returns the wrong date.
=(ToDate(UserResponse("Please Enter As Of Date:");"mm/dd/yyyy hh:mm:ss a"))
When a user runs “03/31/2004 12:00:00 am” the results of the above return 12/31/2004. Any thoughts on what I am doing wrong?
It appears that the todate function is not working properly.
zamboni95 (BOB member since 2004-04-07)
system
July 15, 2004, 7:19pm
2
Did you try AM/PM at the end of the format instead of a?
Randy Jones (BOB member since 2002-08-19)
system
July 15, 2004, 7:31pm
3
Figured it out. Here’s the solution
=(ToDate(UserResponse("Please Enter As Of Date:");"MM/dd/yyyy hh:mm:ss a"))
Notice that the placeholders for the month need to be capitalized.
zamboni95 (BOB member since 2004-04-07)
system
September 2, 2004, 2:32pm
4
Absolutely true. I struggled for a couple of days to convert that string to a data, and heck no. It was giving me #ERROR . Thanks for the enlightment. BO document is useless.
shesur (BOB member since 2004-08-26)