Focal Point
Difference in Months using YYM Format in Dialogue Manager

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1751064172

February 13, 2008, 03:20 PM
Krysti
Difference in Months using YYM Format in Dialogue Manager
Hi,

Does anyone know if this is possible?

Anyone hate dates as much as I do? Mad

This is basically what I want to do (in dialogue manger):

DATE1 = 200801
DATE2 = 200712

DATE1 - DATE2 = 1

DATEDIF does not seem to work with YYM format...
DATECVT does not seem to like YYM format either.

Thanks for any and all help.

Sincerely,

Date Challenged Krysti


WF 767
February 13, 2008, 03:34 PM
Francis Mariani
Use the 'legacy' function YM:

YM(fromdate, todate, outfield)

-SET &ECHO=ALL;

-SET &DATE1 = 200801;
-SET &DATE2 = 200712;

-SET &DATEDIF = YM(&DATE2, &DATE1, 'I6YYM');

-TYPE &DATE1 &DATE2 &DATEDIF




Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 13, 2008, 03:40 PM
FrankDutch
Hi Krysti

The only reason to hate dates is because you grow older every day....LOL

I have advised this before, buy the book "almost 1001 Ways to Work with Dates in WebFOCUS"
It will cost you 25 $ and it's worth all the money.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

February 13, 2008, 03:58 PM
Krysti
Francis,

You are awesome!!! Thank you so much! Cool

Krysti


WF 767
February 13, 2008, 04:02 PM
Krysti
Frank,

Thanks for the reminder about the book. I think someone here might have a copy of that.

I think I'm finally starting to understand better what does and doesn't work with what.

That YM function was one of the last pieces of the puzzle... well, at least that's what I think right now anyway!

Thanks for the advice. Smiler

Krysti


WF 767
February 13, 2008, 04:19 PM
GinnyJakes
quote:
-SET &DATEDIF = YM(&DATE2, &DATE1, 'I6YYM');


This is a nit but the outfield is not a date but an integer and as such, the format should be 'In' e.g. 'I2'.

Also, Krysti, check out the Legacy Dates functions in the functions manual for things you can do with dates in Dialogue Manager.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 13, 2008, 05:24 PM
Francis Mariani
quote:
-SET &DATEDIF = YM(&DATE2, &DATE1, 'I6YYM');


I6YYM is an integer, not a date, but you're right, I could have coded it

-SET &ECHO=ALL;

-SET &DATE1 = 200801;
-SET &DATE2 = 200712;

-SET &DATEDIF = YM(&DATE2, &DATE1, 'I4');

-TYPE &DATE1 &DATE2 &DATEDIF



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 13, 2008, 06:55 PM
Alan B
Thank you Ginny.

From one nit picker to another.. Wink


Alan.
WF 7.705/8.007
February 14, 2008, 08:50 AM
GinnyJakes
You are most welcome, Alan.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google