DATE_PART on Calculated Column in Query

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

DATE_PART on Calculated Column in Query

Post by Jhstephenson »

I have a TIMESTAMP attribute in a BO that, right now, I am showing on a query. Works fine.

I would like to separate it into two columns on the query; one for date and one for time.

So, I add a calculated column with the expression: DATE_PART(Hearings.DateScheduled) and set it as type Date.

When the query runs nothing shows up in the column.

Is it not possible to do what I am trying to do?

I also tried converting it to a string with: AS_STRING(DATE_PART(Hearings.DateScheduled), 'MM/dd/yyyy').
But I get an error saying it is an invalid expression.

Am I missing something here?
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: DATE_PART on Calculated Column in Query

Post by Jaymer »

IMHO, calculated columns are weak and hard to use.
you cannot filter or sort on them (unless this has changed) and its hard to debug a statement - takes a lot of trial and error to get a result - I think MAYBE there will be feedback in the Server or Tomcat window if you have something wrong with an expression.
This has been said before, but the concept is fabulous, but the execution of Calc Columns just doesn't cut it, so you're best bet is to have physical fields maintained by Rules and use them in the grid.
Also, its a hassle to use Kendo filtering on Timestamp columns (as you may be finding out).

Calculated Columns are not your friend.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: DATE_PART on Calculated Column in Query

Post by Jhstephenson »

Thanks Jaymer, Sadly what you are saying is true.
Post Reply