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] Error comparing date/time field to database field...

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Error comparing date/time field to database field...
 Login/Join
 
Master
posted
I built a date/time field and I am trying to compare it to a date defined in FOCUS.
I am getting errors!?!?

-*
 -SET &BEG1 = '20081201';
 -SET &END1 = '20081231';
 -*
 -SET &BEGDT = EDIT(20081201,'9999/99/99') |''| '00:00:00';
 -SET &ENDDT = EDIT(20081231,'9999/99/99') |''| '23:59:59';
 -*
 -TYPE 2008/12/01 00:00:00 . . . . . . 2008/12/31 23:59:59
 2008/12/01 00:00:00 . . . . . . 2008/12/31 23:59:59
 -*
 -*
 JOIN CLEAR *
-* Here, I have a WHOLE BUNCH of JOINs
 -RUN
 -*
 TABLE FILE WHATEVER
 BY RESULT_DATE
 WHERE RESULT_DATE GE '2008/12/01 00:00:00' LE '2008/12/31 23:59:59';
 IF RECORDLIMIT EQ 15
 END
-RUN
 -EXIT
 0 ERROR AT OR NEAR LINE     33  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC015) THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH: 2008/12/01
 00:00:00
 0 ERROR AT OR NEAR LINE     33  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED
 (FOC009) INCOMPLETE REQUEST STATEMENT
 BYPASSING TO END OF COMMAND
 -*
 -SET &BEG1 = '20081201';
 -SET &END1 = '20081231';
 -*
 -SET &BEGDT = EDIT(20081201,'9999/99/99') |''| '00:00:00';
 -SET &ENDDT = EDIT(20081231,'9999/99/99') |''| '23:59:59';
 -*
 -TYPE 2008/12/01 00:00:00 . . . . . . 2008/12/31 23:59:59
 2008/12/01 00:00:00 . . . . . . 2008/12/31 23:59:59
 -*
 -*
 JOIN CLEAR *
-* Here, I have a WHOLE BUNCH of JOINs
 -RUN
 -*
 TABLE FILE WHATEVER
 BY RESULT_DATE
 WHERE RESULT_DATE GE '2008/12/01 00:00:00' LE '2008/12/31 23:59:59';
 IF RECORDLIMIT EQ 15
 END
-RUN
 -EXIT
 0 ERROR AT OR NEAR LINE     33  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC015) THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH: 2008/12/01
 00:00:00
 0 ERROR AT OR NEAR LINE     33  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED
 (FOC009) INCOMPLETE REQUEST STATEMENT
 BYPASSING TO END OF COMMAND


Below is what just a report of the RESULT_DATE field.

-*
 TABLE FILE WHATEVER
 BY RESULT_DATE
 IF RECORDLIMIT EQ 3 
 END
-RUN
....
Here is a little report:
RESULT_DATE 
2000/03/28 00:00:00 
2000/03/29 00:00:00 
2000/03/30 00:00:00 


In the WHATEVER Master File, RESULT_DATE is defined:
FIELDNAME=RESULT_DATE, ALIAS=RESULT_DATE, USAGE=HYYMDS,
ACTUAL=HYYMDS, MISSING=ON, $

Any Ideas??? Sweating

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Virtuoso
posted Hide Post
If you do not need the time part in the date field in your database (Result_Date) try to remove it.

How

Change the master file description or create an new defined field.

NEWDATE/YYMD=HDATE(RESULT_DATE,'YYMD');

Now you can select on this more simple field.




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
Expert
posted Hide Post
1)
WHERE RESULT_DATE GE '2008/12/01 00:00:00' LE '2008/12/31 23:59:59';
is not a valid shortcut for FROM-TO or GE and LE selection

2) Because the date-time field in WHATEVER is an HYYMDS field, your filter should look like this:

WHERE RESULT_DATE GE DT('2008/12/01 00:00:00') AND RESULT_DATE LE DT('2008/12/31 23:59:59');

You may need to use - instead of /, depending on the DBMS of the table):

WHERE RESULT_DATE GE DT('2008-12-01 00:00:00') AND RESULT_DATE LE DT('2008-12-31 23:59:59');


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
Master
posted Hide Post
PROBLEM SOLVED


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Virtuoso
posted Hide Post
How Tom
was one of our suggestion of any help?




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
Master
posted Hide Post
quote:
WHERE RESULT_DATE GE DT('2008/12/01 00:00:00') AND RESULT_DATE LE DT('2008/12/31 23:59:59');


Thank you both for your suggestions. They are
both workable, but I liked using the true
date/time field, and I have always LOVED coding in Dialogue Manager!

Thanks! Cool


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 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     [SOLVED] Error comparing date/time field to database field...

Copyright © 1996-2020 Information Builders