HPlogo ALLBASE/SQL C Application Programming Guide: HP 3000 MPE/iX Computer Systems > Chapter 11 Programming with ALLBASE/SQL Functions

Coding Considerations

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The following list provides helpful reminders when you are using date/time functions:

  • Input functions require leading zeros to match the fixed format of an element. (Z is not supported.)

  • For all date/time functions, when you provide only some elements of the complete format in your format specification, any unspecified elements are filled with default values.

  • Arithmetic operations are possible with functions of type INTEGER.

  • The length of the data cannot exceed the length of the format specification for that data. The maximum size of a format specification is 72 bytes.

  • Because LIKE works only with CHAR and VARCHAR values, if you want to use LIKE with date/time data, you must first convert it to CHAR or VARCHAR. For this you can use the TO_CHAR conversion function.

  • MIN, MAX, COUNT can be used with any DATE/TIME column type. SUM, AVG can be used with INTERVAL data only.

  • Do not specify an indicator variable as a parameter of a date/time function used in the select list of a query.

  • When using the ADD_MONTHS function, if the addition of a number of months (positive or negative) would result in an invalid day, the day field is set to the last day of the month for the appropriate year, and a warning is generated indicating the adjustment.

Feedback to webmaster