I'm trying to build an insert query that will add a
value into a field , after the first insert query adds
the record.

Relevant table information:

+-----------------+---------+------------+----------+
| RecordID        | InitOn  | LenChoice  | EndDate  |
+ [PrimID,AutoInc]| [Date]  |   [int]    |  [Date]  | 
+-----------------+---------+------------+----------+

So in the first insert the RecordID, InitOn (Using
select NOW()), and LenChoice would be inserted. 
Looking something like this:

+-----------------+-----------+------------+----------+
| RecordID        | InitOn    | LenChoice  | EndDate 
|
+-----------------+-----------+------------+----------+
|  10043          | 11/26/2004|     7      |         
|
+-----------------+-----------+------------+----------+

Now I try to use (and I've tried an update statement
as well:

Insert MyTable (EndDate) Values(DATE_ADD(InitOn,
INTERVAL LenChoice DAY)) 

Which I would hope to result in:

+-----------------+-----------+------------+----------+
| RecordID        | InitOn    | LenChoice  | EndDate 
|
+-----------------+-----------+------------+----------+
|  10043          | 11/26/2004|     7     
|12/02/2004|
+-----------------+-----------+------------+----------+

However what is returned is an error message "Column
EndDate cannot be NULL.

Anyway idea what I'm doing wrong ?

Stuart

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to