cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert user response date to text date month and year???

0 Kudos
262

Hi!

I have a syntax that brings on the date to and from , from the user response as a complete date in MM/dd/yyyy format. I would like to display the date in the format with the month name instead of the date format.

Currently based on the syntax that I have below :

="Incident Date Range: "+ Replace(Replace(UserResponse("Incident Date Range");"12:00:00 AM";"");";";"-")

I get the date as "Incident date Range : 3/13/2017 - 3/19/2017". I would like to see the date as " "Incident date Range: March 13 To March 19".

Is it possible to do so and if so , what should the modification be on my syntax above.

help will be greatly appreciated.

Thanks

View Entire Topic
mhmohammed
Active Contributor
0 Kudos

Hi Sumit,

Try to create the below variables, I'm leveraging the work you already did.

v_Date Range = Replace(Replace(UserResponse("Incident Date Range");"12:00:00 AM";"");";";"-")

This will give you the result as 3/13/2017 - 3/19/2017, per what you wrote above.

v_Start Date =FormatDate(Todate(Substr([v_Date Range];1;Pos([v_Date Range];" ")-1));"");"Mmmm d") (use dd if you want to see 2 digits for dates 01,02,03,..,09)

v_End Date =FormatDate(Todate(Substr([v_Date Range];Pos([v_Date Range];"-")+2;Length([v_Date Range]));"");"Mmmm d")

v_Final Date Range = [v_Start Date]+" - "+[v_End Date]

Hope that helps!

Thanks,
Mahboob Mohammed