Quantcast
Channel: SCN : Unanswered Discussions - Semantic Layer
Viewing all articles
Browse latest Browse all 1291

Calculate difference between two dates connecting to a BW cube via JCo

$
0
0

Hello,

 

This sounds simple but I haven't been able to get it to work. I have a start date composed of a date field and a time field (I should probably merge the two into a DateTime field) and an end date composed of only a date field. I need to calculate the difference between the two in days (preferably hours as well). Using timestampdiff() fails as follows:

 

timestampdiff(4, cast(@Select(Date type field) as timestamp), cast(@Select(Date type field) as timestamp))

Returns incorrect values. For example, with two dates of 5/2/2013 and 5/15/2013, I get a result of -26.


timestampdiff(4, @Select(Date type field), @Select(Date type field))

When I click Validate in IDT, it says, "Unsupported signature 'TIMESTAMPDIFF(INTEGER, DATE, DATE)'"

 

We are connecting to a BW cube with a JCo relational connection and the underlying BW database is SQL Server. I tried using the native datediff() function but it failed with "The column name 'd' could not be found in any of the tables or subqueries of the FROM clause."

 

Any ideas?

 

Thanks.


Viewing all articles
Browse latest Browse all 1291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>