[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

502.0. "SYS DATE format ?" by ISLNDS::MORIN () Wed Mar 25 1992 13:51

    Software versions:
    
    VMS 5.4
    FOCUS 6.1.1
    
    
    Problem:
    
    I retrieve the current system date using:
    
          tdate/a8=today(tdate);
    
    which formats the date as mm/dd/yy (03/25/92) .
    
    Is there a way to convert the format to 'MAR 25 1992' so that I can do
    calculations of time spans between the current date and a date stored
    in the database.   
    
    I have been able to do the calculations if I hard-code a date field 
    as follows: NEWDATE/I5='MAR 25 1992' - DATE_TIME;
                                             |(database date)
    
    Peter
T.RTitleUserPersonal
Name
DateLines
502.1GETSTIMEAIMHI::CIONI_LWed Mar 25 1992 15:485
Did you try using subroutines like GETSTIME to retrieve the DEC
standard date and time field?

LisaC
502.2Try dialogue manager variablesKAHALA::FOREMANNothings Impossible, you just run out of timeWed Mar 25 1992 15:4911
    It depends on the format of your database date ( if your talking about
    and RDB database with a field described as DATE it's a whole different
    ballgame ).  If I were you I'd try using the system variable date
    functions (&DATE, &MDY,&DMY,&YMD) via a dialogue manager set
    statement.  At least with these you're starting with a value that
    FOCUS understands to be a date, not a text string like you get with
    the TODAY function.
    
    Good luck,
    
    Sharon
502.3defined field substitution with IF statementISLNDS::MORINThu Mar 26 1992 11:2834
    
    
    
    
    Below you will find the fex used to retrieve system date less specified
    number of day.  The process to define the TESTDATE field works fine.  
    
    The next step is to use the field value in a conditional test.  When I
    try to use the defined field in an IF statement I get the following
    error : 
    
    (FOC006) FORMAT OF TEST VALUE IS INCORRECT : TESTDATE
    
    Is there a special format used to evaluate the value in a defined
    field? 
    
    Peter
    
    BTW: Thanks for pointing me in the right direction for retrieving
    current system date.
    
    
    
DEFINE FILE TEST
TESTDATE/I6= AYMD(&YMD,-42,TESTDATE);
END

TABLE FILE TEST
PRINT DATE_TIME AND TESTDATE
IF DATE_TIME GE TESTDATE
                  |-------------- VARIABLE IN QUESTION
    IF RECORDLIMIT EQ 10
END

502.4Use Where to compare valuesKAHALA::FOREMANNothings Impossible, you just run out of timeFri Mar 27 1992 14:188
    Hi,
    
    Change your IF statement to a WHERE statement and it should correct
    your problem ( need a semi-colon at the end ).
    
    WHERE DATE_TIME GE TESTDATE;
    
    Sharon
502.5Literal datatypeEVTDD1::CARRIEREJean-Claude CarriereSat Mar 28 1992 07:426
	The other solution is to change TESTDATE datatype (e.g. to a YMD)

	DEFINE FILE TEST
	TESTDATE/YMD=AYMD(&YMD,-42,TESTDATE);
	END
502.6Resolution to Date problemISLNDS::MORINWed Apr 01 1992 14:5126
    Thanks for all your help.  Attached is the process I decided to use to
    resolve the proplem in .0.
    
    
DEFINE FILE TEST
TESTDATE/I6= AYMD(&YMD,-42,TESTDATE);
END

FILEDEF TKNDTE DISK TKNDTE.FTM

TABLE FILE TEST
PRINT TESTDATE
IF RECORDLIMIT EQ 1
ON TABLE HOLD AS TKNDTE
END
    
    
    The way I tested the database field against the date in the hold file
    was:
    
    IF DATE_TIME GE (TKNDTE)
    
    
    Thanks again for everybodies help.....
    
    Peter