cancel
Showing results for 
Search instead for 
Did you mean: 

Re: ToDate() function not working

csk901
Explorer
0 Kudos

Hi,

In my current problem date is actually stored without timestamp (in Teradata database), but when I use it in report prompt, it adds the timestamp (12:00:00 AM) by default, and my ToDate function on UserResponse to prompt is resulting in #ERROR. Here is the description of the issue

Date in Database:

12/7/2013

12/14/2013

9/21/2013

Prompt values (Date Object):

12/7/2013 12:00:00 AM

12/14/2013 12:00:00 AM

9/21/2013 12:00:00 AM

In report I am trying to use this formula & it is resulting in #ERROR

=ToDate(UserResponse([DP1];"Week Ending Date (Start):");"MM/dd/yyyy")

Even I tried the one below, but same #ERROR

=ToDate(UserResponse([Selection].[Shipment Quantity in UOM];"Week Ending Date (Start):");"MM/dd/yyyy hh:mm:ss AM/PM")

I am just trying to display the date part in report. Please let me know how this format need to be given to get that date part.

Thanks,

CK

Message was edited by: Simone Caneparo branched to a new thread so it gets more attention

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Don't use MM - it would expect 09, not 9 for September

Use:

=ToDate(UserResponse("Your Date Prompt"); "M/d/yyyy hh:mm:ss A")

Former Member
0 Kudos

=ToDate(LastExecutionDate();"dd/MM/yyyy")

This is worked for me..Use Userepsones in place of Last Execution Date..It should work...

This will laso work

=FormatDate(ToDate(UserResponse("Enter Date");"dd/mm/yyyy") ;"dd/Mmm/yyyy")

arijit_das
Active Contributor
0 Kudos

Try

=ToDate(UserResponse("Week Ending Date (Start):");"INPUT_DATE_TIME")