Re: DATETIME comparisions
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Data Types & Schema Design
Ian Morris (ianm@compnews.co.uk) wrote: : I want to be able to compare two datetime datatypes in esql/c to find which : one is the most recent. In 4GL it is easy but how is this done in esql/c ? : I have defined the data type as : $datetime year to second date_edited; : $datetime year to second date_transmitted; : I want to check if the variable 'date_transmitted' is more recent then the : variable 'date_edited'. Decimal type is also a structure. However, it appears that both datetimes will have the same qualifier. Since that's the case, you should be able to directly access and compare the decimal portion of the dtime structure. Code might look like this: deccmp(&(date_edited.dt_dec),&(date_transmitted.dt_dec)) That's off the top of my head so it's probably not exactly right. Basically you want to send the address of the decimal structure portion of the dtime structure to the decimal compare function. Probably not the most straightforward methodology, but as long as the two qualifiers are the same, should get you where you need to go. Feel free to email any other questions. -- ----- Scott Morizot ----------- tmorizot@eden.com -----