Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DELETING A SPECIFIC FIELD

Status
Not open for further replies.

kingjjx

Programmer
Sep 18, 2001
181
US
I have 2 tables .. a customer table and a auto_rental table.
the common field between the 2 table is the customer# field.

an auto is assigned a customer#, once a customer rents the auto .... what i want to do is be able to take out that customer number once the customer has returned the auto.

how can i delete the customer# field in the auto_rental table ??? I tried to create a form and pass a hidden value if NULL to the customer# field but it didnt work.

how can i do this ?

thanks
-j
 
Using the SQL DELETE command:

DELETE FROM
auto_rental
WHERE
CustomerID = id_you_want_to_delete


-Tek
 
You want to clear out the customer number field in the auto_rental table, correct? Can you pass in the ID of the car?

You should be able to do something lke

Update auto_rental
Set customer_number = NULL
Where car_id = #form.mycarid#

or if you pass in the customer ID:

Update auto_rental
Set customer_number = NULL
Where customer_number = #form.customer_number#

But a possible problem with that is if your customer has more than one car rented, it will clear all cars. A better key might be the car id, since I would think that would be unique.

HTH,
Tim P.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top