Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Format

Hi

I am extracting data from SAP BW and I have a date field having the format DD.MM.YYYY.  I want to change it to MM/DD/YYYY. I have tried using the function below but it's not returning any value. I have also tried changing the DateFormat in the script but to no avail.

date#((Date([Posting date - Posting date Level 01 (Text)],'DD.MM.YYYY')),'MM/DD/YYYY')  as [Posting Date]

qv1.PNG

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try exchanging the date() and date#() position like:

date(Date#([Posting date - Posting date Level 01 (Text)],'DD.MM.YYYY'),'MM/DD/YYYY')  as [Posting Date]

View solution in original post

11 Replies
tresesco
MVP
MVP

Try exchanging the date() and date#() position like:

date(Date#([Posting date - Posting date Level 01 (Text)],'DD.MM.YYYY'),'MM/DD/YYYY')  as [Posting Date]

Anil_Babu_Samineni

You can use simply Date(FieldName, 'MM/DD/YYYY') as [Posting Date];

And do you have timestamp with that field

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shraddha_g
Partner - Master III
Partner - Master III

it should be

date(Date#([Posting date - Posting date Level 01 (Text)],'DD.MM.YYYY'),'MM/DD/YYYY')  as [Posting Date]

Anil_Babu_Samineni

Shraddha, Tresesco also gave same scenario. Why do you copy same thing. I recommend you to think different approach so that we might learn lot.

- Good Luck

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Like this ?

1.     Date(Fieldname,'DD/MM/YYYY') as Date

or else try below one

2.     Date(Date#(Fieldname,'DD.MM.YYYY'),'DD/MM/YYYY') as Date

I hope this might helps you.

-Nagarjuna

vcanale
Partner - Creator II
Partner - Creator II

Hi,

Try

[ YourField1 ] - [ YourField2 ]
eg:
Date( [ Posting date ] - [ Posting date Level 01 (Text) ], 'MM/DD/YYYY' )  as [ Posting Date ]

prabiradhikary
Partner - Contributor III
Partner - Contributor III

Plz use this

Text(date(Date#([Posting date - Posting date Level 01 (Text)],'DD.MM.YYYY'),'MM/DD/YYYY'))  as [Posting Date]

sunny_talwar

It would be helpful for you to go over these links

Why don’t my dates work?

Get the Dates Right

Anonymous
Not applicable
Author

This is not returning any value.