Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED] DATEDIFF IN SQL SERVER AND DATEDIF IN WEBFOCU
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] DATEDIFF IN SQL SERVER AND DATEDIF IN WEBFOCU
 Login/Join
 
Silver Member
posted
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
 
Posts: 32 | Location: Cambridge, Ontario, Canada | Registered: June 02, 2014Reply With QuoteReport This Post
Silver Member
posted Hide Post
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
 
Posts: 32 | Location: Cambridge, Ontario, Canada | Registered: June 02, 2014Reply With QuoteReport This Post
Guru
posted Hide Post
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
 
Posts: 487 | Location: Toronto | Registered: June 23, 2009Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED] DATEDIFF IN SQL SERVER AND DATEDIF IN WEBFOCU

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.