I have a timestamp field that has a data type of date and is formatted as:
mm/dd/yyyy hh:mm:ss
I have two needs associated with this.
I would like to define two additional objects at the universe level. One that has the hour portion only and one that has the day portion only, but I haven’t been able to figure out how to do so. I applied a format to the timestamp to make it look like it is the hour only, but if you try to build a variable in the report it doesn’t like it because in the background it is still a date field, not a number.
When I try the Day function I get the following error: The expression type is not compatible with the object type
When I try EXTRACT(DAY FROM KC.EQP_ONLN_TRIP_FACT.DERAMP_TMSTMP) I get the following error:
An unexpected token “DAY FROM KC.EQP_ONLN_TRIP_FACT.DERAMP_TMSTMP” was found following “Select Extract(”
The result of the DAY() function is a number (large integer to be precise) so the universe object that uses this function must be of a number type. You probably had it defined as a character type.