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     Date compare problem

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date compare problem
 Login/Join
 
Gold member
posted
Hi All,

After hours of struggling with this, I give up, Help! Smiler

I have the following situation..
SQL Server table accessed in Developer Studio. This is a simple version of the data I am trying to retrieve:

-SET &DATER = &YYMD;
-SET &DATER2 = DATEADD(&DATER, 'M', -1);

TABLE FILE MYTABLE
PRINT
PROJCODE
IF PROJDATE EQ '&DATER2'
END

..If I use the first &DATER in the GE statement, i get a result, but as soon as I try and do any sort of 'formatting' on the date (and believe me I have tried so many combinations!) I get the message:

(FOC177) INVALID DATE CONSTANT: ********
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND

I have also tried this within a define statement as well as compute.

Any help would be greatly appreciated!

Thanks,

K.


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
 
Posts: 78 | Location: UK | Registered: February 07, 2008Report This Post
Expert
posted Hide Post
What do you mean by "'formatting' on the date"?

Which date, the Dialogue Manager variable or the data column?

What kind of formatting are you talking about? The line of code is a WHERE statement. If the data column is a SQL DateTime column then you have to set up the WHERE statement differently.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
By date formatting I mean be able to use the DATEADD function to get the previous month/ or day or year for that matter.
if I use the following, my results are fine:
IF PROJDATE EQ '&DATER'
with this I get all the data from today, but say I want all the data from last month, as in &DATER2, the error occurs.
The field is a SQL server datetime field.

Thanks.

K.


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
 
Posts: 78 | Location: UK | Registered: February 07, 2008Report This Post
Expert
posted Hide Post
Try AYMD instead. It works better for Dialogue Manager variables.
-SET &DATER = &YYMD;
-SET &DATER2 = DATEADD(&DATER, 'M', -1);
-SET &DATER3 = AYMD(&DATER,-1,'I8YYMD');
-TYPE &DATER &DATER2 &DATER3
  


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
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
If the column is defined as HYYMDS in the Master, you will have to add Time to the Dialogue Manager variable, something like:

-SET &DTTM1 = EDIT(&DT1, '9999/99/99') | ' 00:00:00.000';

WHERE SCG_JSI_DOCMASTER.SCG_JSI_.SDATE GE '&DTTM1'; 


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
It would help a lot if you post your master of the "mytable" dataset.




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
The mention of the AYMD function lead me to another post that talks about date convert, I had no idea that this was in fact the issue and what was needed, seems that I need to use DATECVT for all my SQL Server dates, for the date funtions like DATEADD and DATEMOV to work in the first place. This is what I am trying at the moment and it is functioning well (though a little clunky...but does the job):
-SET &DATER = &YYMD;
-SET &DATER0 = DATECVT(&DATER,'I8YYMD','YYMD');
-SET &DATER1 = DATEMOV(&DATER0, 'BOM');
-SET &DATER2 = DATEADD(&DATER1, 'M', -1);
-SET &DATER4 = DATECVT(&DATER2, 'YYMD','I8YYMD');

Thanks for the help!


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
 
Posts: 78 | Location: UK | Registered: February 07, 2008Report This Post
Expert
posted Hide Post
Some of your requirements you can do in one -SET command.

Take a look at this:

add date function?


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report 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     Date compare problem

Copyright © 1996-2020 Information Builders