Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Needing "Current Date" in a format other than alpha numeric

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Needing "Current Date" in a format other than alpha numeric
 Login/Join
 
Silver Member
posted
I know this is a super easy question and I'm almost so embarrased to ask but how do I convert the current date (TODAY()) into a format where I can do computations on it (i.e. Date comparisons using LE, GE etc...). Every thing I'm reading is saying the output is A8 and we all know that this will abend as soon as I do a computations with it. There has to be a way to Define it other than alphanumeric. Thanks
 
Posts: 31 | Registered: November 17, 2005Report This Post
Virtuoso
posted Hide Post
Dennis,

There are many date &variables which you can find in the manual. Here are a few:
Numeric
&YMD, &DMY, &MYD
&YYMD, &DMYY, &MDYY

With slashes:
&DATEYMD, &DATEDMY, &DATEMDY
&DATEYYMD, &DATEDMYY, &DATEMDYY

Etc. etc. etc.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Master
posted Hide Post
Dennis,

The answer will depend on where you want to do the caluculations. Are you wanting to do them in a DEFINE, Dialogue Manager, Maintain or MODIFY?


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Gold member
posted Hide Post
TODAX/MDY = &MDY;
TODAY/MDYY = TODAX + 36525;
LATE/MDYY = INVDATE + 30;
MONTH/I2 = (TODAY - LATE)/30;
CURMO/M = TODAY;
CURDA/D = TODAY
CURYR/YY = TODAY;

More examples.
Kent


Windows2003 Server, WebFOCUS 7.7.02 Developers Studio and MRE
 
Posts: 63 | Location: Ft. Wayne, IN | Registered: February 20, 2007Report This Post
Expert
posted Hide Post
If you want the current Date and Time, you could use HGETC
DateTime/HYYMDm = HGETC(10, 'HYYMDm');


As jgelona said, what do you want to do with it ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Hi Jgelona, Thanks for the response. I'm wanting to do this in the Define section. Thanks!

quote:
Originally posted by jgelona:
Dennis,

The answer will depend on where you want to do the caluculations. Are you wanting to do them in a DEFINE, Dialogue Manager, Maintain or MODIFY?
 
Posts: 31 | Registered: November 17, 2005Report This Post
Silver Member
posted Hide Post
Thanks Danny!!! Your information was greatly appreciated!!
quote:
Originally posted by Danny-SRL:
Dennis,

There are many date &variables which you can find in the manual. Here are a few:
Numeric
&YMD, &DMY, &MYD
&YYMD, &DMYY, &MDYY

With slashes:
&DATEYMD, &DATEDMY, &DATEMDY
&DATEYYMD, &DATEDMYY, &DATEMDYY

Etc. etc. etc.
 
Posts: 31 | Registered: November 17, 2005Report This Post
Silver Member
posted Hide Post
Thanks KentO for answering my question. Have a great day!!
quote:
Originally posted by KentO:
TODAX/MDY = &MDY;
TODAY/MDYY = TODAX + 36525;
LATE/MDYY = INVDATE + 30;
MONTH/I2 = (TODAY - LATE)/30;
CURMO/M = TODAY;
CURDA/D = TODAY
CURYR/YY = TODAY;

More examples.
Kent
 
Posts: 31 | Registered: November 17, 2005Report This Post
Silver Member
posted Hide Post
Hi Waz, I was trying to write code to query all records created within the last week (7days) and this job would be executed within Report Caster and automatically emailed to the customer. Unfortunately all my dates are in a datetime format; thus, I need to first truncate the time before I start calculating to figure out which records were created within the last week. Thanks for responding to my question!!
quote:
Originally posted by Waz:
If you want the current Date and Time, you could use HGETC
DateTime/HYYMDm = HGETC(10, 'HYYMDm');


As jgelona said, what do you want to do with it ?
 
Posts: 31 | Registered: November 17, 2005Report This Post
Virtuoso
posted Hide Post
Dennis,

If I understand you correctly, you have a date fielf - let's call it DATEF - which has a datetime format and you want it to be greater than today - 7 days. You could to the following:
  
-SET &DAY7=AYMD(&YYMD, -7, 'I8YYMD');
-SET &DT7=&DAY7 | ' 00:00:01';

in your TABLE:

WHERE DATEF GT DT(&DT7);


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
Dennis, there are several ways to do what you want.

As long as you have the start and end dates, this is easy.
Here are some suggestions

  • Create a where clause using the DT function
  • If your source data is relational, add an extra line to the master defining the datetime field as a date (e.g. Usage:YYMD Actual: DATE), then use normal where clause to get the range
  • Using a DEFINE convert the datetime field to DATE (Use function HDATE), then test against this field.

I would suggest the first option as it will be more efficient.

e.g.
WHERE DT_FIELD GE DT(&Startdate 00:00AM)
WHERE DT_FIELD LT DT(&Enddate 00:00AM)


The & Dates are in the format YYMD.

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


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Needing "Current Date" in a format other than alpha numeric

Copyright © 1996-2020 Information Builders