Forum

Data type error - I...
 
Notifications
Clear all

Data type error - I think!

7 Posts
2 Users
0 Reactions
152 Views
(@agwalsh)
Posts: 100
Estimable Member
Topic starter
 

I've created a custom column as follows..

if([Deferred_percentages.Deferred]<>0 or [Deferred_percentages.Deferred]<>1)  These are both formatted as decimal numbers

and ParameterEarnedDate >=[StartDate]  First one is a parameter query (formatted as date), [Start Date] is formatted as date

then ([Amount]*(1-[Deferred_percentages.Deferred])+(ParameterEarnedDate-[StartDate])*[Amount_earned_per_day]) else 0

([Amount] and [Amount_earned_per_day])= Decimal number

 

This is the error message I am getting.. do I need to change data types?  What am I missing?

Expression.Error: We cannot apply operator + to types Number and Duration.
Details:
Operator=+
Left=0
Right=27.17:26:37.6642335

 
Posted : 29/01/2019 12:00 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Anne,

I think this part of the formula (ParameterEarnedDate-[StartDate]) is the problem because it's a date/duration and you're trying to add it to a number. So yes, you need to convert the data type for that to a number.

Mynda

 
Posted : 30/01/2019 8:14 am
(@agwalsh)
Posts: 100
Estimable Member
Topic starter
 

Yes, so OK, at least I know I am on track...:-) So what function should I use for that and what syntax? Thanks 🙂 

 
Posted : 01/02/2019 7:03 am
(@mynda)
Posts: 4761
Member Admin
 

Can you upload a file with your data so I can see it in context?

 
Posted : 01/02/2019 8:25 pm
(@agwalsh)
Posts: 100
Estimable Member
Topic starter
 

I tried answering in this box but it wouldn't let me so I am attaching a file with the data and a file with the various explanations..thanks again 🙂

 
Posted : 02/02/2019 6:22 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Anne,

The Excel file appears to have been removed and the Word document is empty. Can you please try again?

Mynda

 
Posted : 02/02/2019 6:33 am
(@agwalsh)
Posts: 100
Estimable Member
Topic starter
 

GRRR.. I actually found another way around it after this but thanks for your help anyway 🙂

 
Posted : 12/02/2019 12:51 pm
Share: