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     [SOLVED] Extracting Day only from a datetime field (HYYMDS)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Extracting Day only from a datetime field (HYYMDS)
 Login/Join
 
Silver Member
posted
Hi,
As the Subject suggest i want to extract a day from datetime field
Full Scenario is that i want to implement the folowing query,
iif(
(day(order_paid_time)<16 AND month[order_paid_time)=month[date[)))
,"fifteenth"
,IIF>16 AND (month(order_paid_time)=month(date())-1))
,"first","exclude"))as period

This message has been edited. Last edited by: <Kathryn Henning>,


WF 8.0.08, Dev Studio, Apache Tomcat/7, MS IIS 7, MySQL, MS Windows 7, I.E. 9, Output formats: HTML, Excel 2007, PDF, Active HTML, Active PDF
 
Posts: 33 | Registered: September 05, 2014Report This Post
Expert
posted Hide Post
do you have a USING FUNCTIONS manual? if not, download it, and look up HPART function.
just what you need.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
You won't need everything below, but the concept will remain the same :

DEFINE FILE EMPDATA
CURDATE   /YYMD   = &YYMD;
CURDTTM   /HYYMDS = HDTTM(CURDATE, 10, 'HYYMDS');
CURMTH    /I2     = HPART(CURDTTM, 'MONTH', 'I2');
PRVDATE   /YYMD   = DATEADD(CURDATE, 'M', -1); 
PRVDTTM   /HYYMDS = HDTTM(PRVDATE, 10, 'HYYMDS');
PRVMTH    /I2     = HPART(PRVDTTM, 'MONTH', 'I2');
HIREDTTM  /HYYMDS = HDTTM(HIREDATE, 8, 'HYYMDS');
MTH       /I2     = HPART(HIREDTTM, 'MONTH', 'I2');
DAY       /I2     = HPART(HIREDTTM, 'DAY', 'I2');
PERIOD    /A10V   = IF DAY LT 16 AND MTH EQ CURMTH THEN 'FIFTEENTH'
               ELSE IF DAY GT 16 AND MTH EQ PRVMTH THEN 'FIRST'
               ELSE 'EXCLUDE';
END
TABLE FILE EMPDATA
PRINT HIREDTTM
      DAY
      MTH
      CURMTH
      PRVMTH
      PERIOD
BY HIREDATE
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Guru
posted Hide Post
Hi Mubbashir,

Welcome to the forum!!!

Documents available in your DS setup itself..\ibi\DevStudio80\bin\function.chm

Even, simple
-TYPE &DATEwr &DATEMDYYtr
will do the trick, but as part of your requirement use DATE-TIME/DATE functions to accomplish it.


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Silver Member
posted Hide Post
Thank You ALL
 
Posts: 33 | Registered: September 05, 2014Report 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     [SOLVED] Extracting Day only from a datetime field (HYYMDS)

Copyright © 1996-2020 Information Builders