cancel
Showing results for 
Search instead for 
Did you mean: 

Expression type not compatible with Object type- error- UDT

Former Member
0 Kudos

Hi guys

we recently migrated our database from oracle to SQL. So now I am trying to fix the universes . There is a datetime object in one of the tables and it needs to be converted to Date. The old oracle sql was TRUNC(table1.field1)

Now I have to convert it into SQL so I am trying this:

CAST(table1.field1 as DATE) but it gives me the error "

Expression type not compatible with Object type"

It works fine when I run it in sql server...

Any idea?

Accepted Solutions (0)

Answers (1)

Answers (1)

sonet_kebede
Advisor
Advisor
0 Kudos

Hello,

You need to change the Data Type from DateTime to Date.

Thanks,

Sonet

Former Member
0 Kudos

Change data type where?

sonet_kebede
Advisor
Advisor
0 Kudos

Definition Tab of the Edit properties of "your object" window.

or Double click the object and you will see the Name of the object and Type

Former Member
0 Kudos

It is already in Date format...

sonet_kebede
Advisor
Advisor
0 Kudos

Normally, Expression type not compatible with Object type mean that object definition data type is not set as same way as your database or if there is a conversion than you have to set it based on that conversation. What's the version of BO are you using? if you did not convert his object, would the object parse? if yes, what is the data type?

Former Member
0 Kudos
Its BO 4.2

If I convert this object to 'Char', it parses fine.

sonet_kebede
Advisor
Advisor
0 Kudos

If you did not convert his object, would the object parse? if yes, what is the data type you select?

Normally, DATETETIME and SMALLDATETIME in SQL Server should convert to DATE in UDT.

And CHAR, VARCHAR and TEXT should convert to Char in UDT.