PLM 360 General Discussion

Reply
Mentor
dkeeley
Posts: 218
Registered: ‎10-04-2012
Message 1 of 3 (221 Views)
Accepted Solution

Computed Field Syntax

221 Views, 2 Replies
11-28-2013 04:53 AM

Hi,

 

I previosuly used SQLT on computed fields. This now longer appears to work. I believe the new syntax is PosdtgreSQL. Can you tell me how I can extract the week from a date in a computed field? Also how can I display today's date. I can displat the timestanp using 'now()' but I can't figure out how to extract just the date portion.

 

Thanks for you help,

 

David.

Hello David,

 

You can extract the day as a string by using the following formula: to_char(FIELD_NAME,'dd').

 

However, if the target data type is numerical, use the following formula: to_number(to_char(FIELD_NAME,'dd'),'99').

 

Best regards,

Product Support
Andrew.Shaw
Posts: 44
Registered: ‎01-09-2012
Message 2 of 3 (209 Views)

Re: Computed Field Syntax

11-28-2013 07:14 AM in reply to: dkeeley

Hello David,

 

You can extract the day as a string by using the following formula: to_char(FIELD_NAME,'dd').

 

However, if the target data type is numerical, use the following formula: to_number(to_char(FIELD_NAME,'dd'),'99').

 

Best regards,



Andrew Shaw
Premium Support Specialist PLM/PDM
Global Services
Autodesk, Inc.

Mentor
dkeeley
Posts: 218
Registered: ‎10-04-2012
Message 3 of 3 (203 Views)

Re: Computed Field Syntax

11-28-2013 08:22 AM in reply to: Andrew.Shaw

Thanks Andrew! Perfect.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.