cancel
Showing results for 
Search instead for 
Did you mean: 

Webi Date Issue

former_member200330
Participant
0 Kudos

Hi All,

I am creating a Webi Report from an SAP Universe where in i have to calculate the Number of Days Between two dates, One of the Date is the Bill Date of Materials which comes from Universe and the other date will be entered by the User.

So i used the following Formula:

CP=UserResponse("Enter CP:")

Now i could get the date from the User's response, but it is coming in String Data Type and i am unable to compare it with the existing date. So i tried to change it into Date using the following formula:

Cmp Dte=ToDate([Cmp Prd];"dd.mm.yyyy")

The syntax is fine but i am having the following Error:

'#ERROR'

I am unbale to understand the problem...Please help,

Thanks & Regards,

NRR

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Simply you can do this............

You are capturing the User date in a variable, ie, CP.

So you need to do is............in that variable write function like this way.......

ToDate(UserResponse("Enter CP:");"")

This will solve your problem.

Regards,

ArunKG

former_member200330
Participant
0 Kudos

Hi Arun,

Thanks for the reply. I've tried the function you specified and it is working fine, but i am having the date in 'MM/dd/yy' but i need the date to be in 'MM/dd.yyyy' format can you specify any change in the formula?

Please Help,

Thanks & regards,

NRR

Former Member
0 Kudos

hI NRR,

Yon can format the display of date object.

Right click on the date object >Clcik on Format Number>Select Date/Time>Check custom and give date/time format as MM/dd.yyyy

Regards

Bilahari M

former_member200330
Participant
0 Kudos

Hi Bilahari,

I tried formatting the field that way already but when i am trying to use it to calculate the amount using this field it is not returning any values.

I guess this is because the format that has been changed is just on the report but not the original format.

Thanks & Regards,

NRR

Former Member
0 Kudos

Hi NRR,

Date does not have any specific format associate with it.You can format it for display in diffferent ways.

For using Date field for some calculation ,you don't have to bother about the format(Unless you are doing Comparision with String field).When you compare a date field with another date field ,format doesn't have any impact on results.

If you are comparing with ,String field, FormatDate is the fundtion you should be looking for.

=FormatDate(LastExecutionDate();"MM/dd.yyyy")

Regards,

Bilahari M

Former Member
0 Kudos

Hi NRR,

You can this function:-

FormatDate([Date];"MM/dd.yyyy")

Regards,

ArunKG

Edited by: ArunKG on Oct 24, 2011 11:59 AM

former_member200330
Participant
0 Kudos

Hi Bilahari,

Actually i am trying to calculate the days between two dates.

Please refer the link below:

Please Help,

Thanks & Regards,

NRR

Former Member
0 Kudos

I would have used the below code to extract date from calendar object prompt.

=ToDate( UserResponse("sPDT");"MM/dd/yyyy hh:mm:ss a")

Hope this helps!!!

Regards,

Bilahari M

arijit_das
Active Contributor
0 Kudos

Use

 Cmp Dte=ToDate([Cmp Prd];"dd.MM.yyyy") 

as mm stands for minute.

Also make sure the date format passed to the ToDate function is correct.