Focal Point
[SOLVED] DATEDIFF IN SQL SERVER AND DATEDIF IN WEBFOCU

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/3567067676

June 16, 2015, 02:01 PM
Virul Patel
[SOLVED] DATEDIFF IN SQL SERVER AND DATEDIF IN WEBFOCU
Hi

I am facing issue with function in SQL vs iWay DM

--SQL Function (Microsoft SQL)
SELECT DATEDIFF(M,'2014-08-31','2015-03-03')
--iWay Function
DATEDIF('2014/08/31','2015/03/03','M')

However SQL Return 7, and iWay Function return 6

When I am passing value from record set in iWay it seems that DATEDIF('2014/08/31','2015/03/03','M') is used by iWay and return 7

However if I test DateDif function in iWay with below parameter
DATEDIF(2014/08/31,2015/03/03,'M')
This returns 7

So, In iWay DM
DATEDIF('2014/08/31','2015/03/03','M') - Return 6, and this
DATEDIF(2014/08/31,2015/03/03,'M') - Return 7

Please Help, Thanks

This message has been edited. Last edited by: Tamra,


Virul Patel
Product :
iWay Data Migrator (8.1)
WebFocus 8.1
SQL SERVER 2012
June 16, 2015, 03:50 PM
Virul Patel
Don't Know

If someone has better answer. I tried below on Transformation and it worked.

DB_EXPR( DATEDIFF(MM,T2.EFFECTIVEDATE,T2.EXPIRATIONDATE) );

[SOLVED]
Thanks,


Virul Patel
Product :
iWay Data Migrator (8.1)
WebFocus 8.1
SQL SERVER 2012
June 17, 2015, 09:11 AM
Tamra
Virul,

Thank you for your update. Your idea is probably just as good as any. The purpose of DB_EXPR is to utilize SQL logic within WebFOCUS.

There is a DB_EXPR function that allows the use of a SQL expression that will
be passed to the relational database to do the aggregation. For information,
refer to chapter 3 on page 133: "DB_EXPR Function: Inserting an SQL Expression
Into a Request" in the: "WebFOCUS New Features Version 7 Release 7.05" manual
(DN4500997.1013) at:
http://documentation.informati...ml/html_wf_7705/77sn
f/7705snf.pdf
(Please note the above URL spans multiple lines.)

This chapter talks about putting a SQL function in a request that is then
passed over to the database engine.


There are not a lot of DATEDIFF function posts in the iWay forum but lots of different ways to use this if you search within the WebFOCUS Forum. Its really a matter of how you are using it.

I will mark the topic solved in the subject line.


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5