urgent problem with update on varchar field 
Author Message
 urgent problem with update on varchar field

Hello,

we have an urgent problem with update.

We are using Ingres 6.3 on a Convex (Unix). Our table field (cmez) contains
a date, but the datatype is varchar(12). For example:

If one has a date like 6-july-1991 12:30 it appears as 199107061230

Now, we have a lot of data which end with '0000' for midnight, and we
want to change them into '2400'. Until now - after some hours of try and
error - we didn't find a solution.

Someone there who can help us?

Thanks, Matz

****************************************************************************
* Mathilde Schmitt                   *   Telefon:                          *
* GSF Neuherberg                     *   (49) 089 / 3187 - 3024            *
* P U C                              *                                     *
* Postfach 1129                      *   E-Mail:                           *

****************************************************************************

--
* Mathilde Schmitt                   *   Telefon: (49) 089 / 3187 - 3024   *



Sat, 21 Dec 1996 16:51:13 GMT
 urgent problem with update on varchar field

: Hello,

: we have an urgent problem with update.

: We are using Ingres 6.3 on a Convex (Unix). Our table field (cmez) contains
: a date, but the datatype is varchar(12). For example:

: If one has a date like 6-july-1991 12:30 it appears as 199107061230

: Now, we have a lot of data which end with '0000' for midnight, and we
: want to change them into '2400'. Until now - after some hours of try and
: error - we didn't find a solution.

: Someone there who can help us?

When you work purely with date fields you wont be able to get Ingres to
output times such as 24:00.  6-july-1991 24:00 = 7-july-1991 00:00 and
therefore Ingres will treat 24:00 as 00:00 on the following day.  This
is for the same reason that you can't get 11:60, since this is more
naturally expressed as 12:00.  Since you are working with varchar fields
can't you simply do some string manipulation to get what you want?

Duncan Mackinder
INGRES UK Technical Support.



Sat, 21 Dec 1996 18:53:34 GMT
 urgent problem with update on varchar field
: Hello,
:
: we have an urgent problem with update.
:
: We are using Ingres 6.3 on a Convex (Unix). Our table field (cmez) contains
: a date, but the datatype is varchar(12). For example:
:
: If one has a date like 6-july-1991 12:30 it appears as 199107061230
:
: Now, we have a lot of data which end with '0000' for midnight, and we
: want to change them into '2400'. Until now - after some hours of try and
: error - we didn't find a solution.

This is untested, but I (obviously) think it is right:

  update datetable
  set datecol = left(datecol,8)+'2400'
  where datecol like '%0000'

========================================================================


BKB Engineering Ltd.,                      (MIME-capable mail agent)
11211-76th Avenue,                
Edmonton, Alberta                          Tel: (403)438-2531 (office)
T6G 0K2                                         (403)437-0860 (home)
Canada                                     FAX: (403)437-3367

========================================================================



Sat, 21 Dec 1996 22:01:49 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. URGENT: Conditonal Sorting with Datetime and Varchar field

2. URGENT:storing a string of 5000 characters into varchar field type

3. URGENT: Shape Command error on large Varchar field.

4. URGENT: Shape Command error on large Varchar field.

5. Reading Long Varchars problem - urgent

6. updating a varchar field

7. BDE coulden't update a Varchar Field: Size 50, Phisycal Length 51

8. Updating a varchar field with a name that contains an apostrophe

9. Cannot Update Varchar field via DB2 Connect/MS-Access NT to VM

10. FIELD UPDATE LOOP URGENT HELP

11. Updating a TEXT field through ADO (URGENT) :(

12. Field Update Loop URGENT HELP


 
Powered by phpBB® Forum Software