Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Date format Issue

Hi Folks,

I'm trying to change Date format , but not sure why only some records are changing and not all.

Date(Date#(Date, 'MMM  DD YYYY  HH:MM[.fff]TT'),'MM/DD/YYYY') as MyNewDate,

I want to convert Date to this Format : 2/24/2015  9:30:15 AM

PFA!

Regards,

As

1 Solution

Accepted Solutions
sunny_talwar

Trim removes extra spaces from the beginning and ending of the string... here I am replacing two spaces with a single space in between the string

View solution in original post

6 Replies
sunny_talwar

Try this

Date(Floor(Date#(Replace(Date, '  ', ' '), 'MMM D YYYY hh:mm[.fff]TT')),'MM/DD/YYYY') as MyNewDate;

YoussefBelloum
Champion
Champion

Hi stalwar1‌,

in this exampe using an inline, does Replace(Date,' ','') act like Trim(Date) ? because I was trying with Trim(Date) and it didn't work..

sunny_talwar

Trim removes extra spaces from the beginning and ending of the string... here I am replacing two spaces with a single space in between the string

YoussefBelloum
Champion
Champion

I really thought TRIM() removes all spaces including those in the middle... Thank you

sunny_talwar

Nope, that is what you use Replace() for..

YoussefBelloum
Champion
Champion

Yes, I see