Length of smallint field
Posted in 2008
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I have a table with a smallint field. A number is entered into a 4gl form. I need it to be 0 padded, four digits wide. however, the LENGTH() function doesn't work on smallint fields. So whether user enters "600" or "0600", the length call below returns 0. How can i get around this, i need it entered in military time by the user, they must enter preceeding zero if time is less that 1000, like "0900". let len = length(calRec.hearing_time) message len
> -----Original Message----- > From: informix-list-bounces@iiug.org [mailto:informix-list- > bounces@iiug.org] On Behalf Of monkeys paw > Sent: Wednesday, September 10, 2008 3:18 PM > To: informix-list@iiug.org > Subject: Length of smallint field > > I have a table with a smallint field. A number is entered into > a 4gl form. I need it to be 0 padded, four digits wide. however, > the LENGTH() function doesn't work on smallint fields. So whether > user enters "600" or "0600", the length call below returns 0. > How can i get around this, i need it entered in military time > by the user, they must enter preceeding zero if time is less > that 1000, like "0900". The easiest way around it would be to use a CHAR(4) variable, instead of a smallint, I think. If you need it as a smallint later, you can convert it. --EEM > > let len = length(calRec.hearing_time) > message len > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list