Hi Cameron,
I believe you would want to use another AND clause as in:
$ship_id=shipmentsid.invoices
DELETE * from invoices WHERE
shipmentsid.shipments=$ship_id AND
shipmentsid.packages=$ship_id AND
shippingdate>two weeks ago
What this query will do is: retrieve all records with the given shipment
ID AND given package ID AND shippingdate > 2 weeks ago; then delete the
table row(s) for the selected records.
Watch out: fine-tune your query using a SELECT statement (do not
experiment with DELETE) so you can be sure that the records you retrieve
are those you intend to delete. Also, make sure to leave referential
integrity intact particularly when deleting linked records.
HTH,
Hendrik Schaink
Cameron wrote:
> Looking to delete information from three databases at the same time based on
> the date. This is on a foxpro database on a Windows platform.
>
> Databases:
> * invoice.dbf
> * shipments.dbf
> * packages.dbf
>
> I believe the relationship between them is the shipmentsid feild. The
> closest thing I and another tech have come up with is this:
>
>
> $ship_id=shipmentsid.invoices
> DELETE * from invoices WHERE
> shipmentsid.shipments=$ship_id AND
> shipmentsid.packages=$ship_id IF
> shippingdate>two weeks ago
>
> This is where it breaks down:
> Not sure is assigning the variable is necessary and if I have even done it
> in the right place or if I am missing something. The script shhould grab
> the date from the system that it is on and delete anything that is earlier
> than two weeks from the date (i.e. 08-09-2005)
>
> ANy thoughts or ideas would be great!
>
> Cameron
>
>
>
> _______________________________________________
> clug-talk mailing list
> [email protected]
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying
--
Hendrik M. Schaink
Chief Consultant
"Integrated Business Solutions & Dependable Service"
InfoVision Consulting
Calgary, Alberta, Canada
Phone: (403) 239-0099
"The Vision: We are the partners of choice for companies and
organizations that share our commitment to creating a world
that is truly wise, courageous, prosperous, innovative,
inclusive, sustainable and humane." --Ruben Nelson
GPG Fingerprint: 1371 0927 8C3C 831F A838 C312 68BC F5DB 010D F3D7
_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying