cancel
Showing results for 
Search instead for 
Did you mean: 

Error while converting yyyyMMdd to date in universe

Former Member
0 Kudos

Hello

We recently migrated from BO 3.1 to 4.1. While converting a character format of date from yyyyMMdd to date in unuverse we used to use the following  convert(date,@Select(Table\Date)). Bud it it is showing the following error.

To avoid this incompatibility, your data of the type 'Char' must be presented according to the Date format ''mm/dd/yyyy HH:m:s'', for example, '02/01/2014 11:50:59'.

Is there any solution??

Thanks

Anil

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member4998
Active Contributor
0 Kudos

HI

In IDT you can use create custom display format option in business layer....or use the function TO_CHAR

Please find the below link.

former_member195290
Contributor
0 Kudos

Hi Anil,

what is the backend Database you are using?

Regards,

Javed

Former Member
0 Kudos

Javed,

SQL Server

Thanks

Anil

former_member195290
Contributor
0 Kudos

Hi,

Create a new object.

Your date object : Date

New Object :

= CONVERT(VARCHAR(10),Date,110)


This will give you date is mm/dd/yyyy format.


Try this.


Check this for the format you need :


SQL Server CONVERT() Function


Regards,

Javed

Former Member
0 Kudos

Hi,

My date is in yyyymmdd format. Converting it to varhcar(10),110 is resulting the same.

Thanks

Anil

former_member195290
Contributor
0 Kudos

Hi Anil,

Have you tried the different formats available in the link provided.

Please let me know if its wokring if you try any other conversion code.

Regards,

Javed

Former Member
0 Kudos

You cannot convert directly from int to date - you need to covert to char first.

Use this:

convert(date,cast(tablename.colname as CHAR(8)) ,112)