delete query and update query

  • Thread starter Thread starter balu
  • Start date Start date
B

balu

dear friends,
table [ invoice]
fields [invoiceid] number
" [date] date
" [ quantity] number
i would like to delete some data between the dates of my choice and i want
to add data of (sum of invoice.quantity) between the dates of my choice to
the table invoice
purpose: to compact and keep the database size small at choice of user but
at the same time invoice.quantity will be summed up and added to the same
table for perfect opening and closing balence calculations
can any one please help me .
 
Hi balu,

Here is one way to delete the invoice data.

Create a query based on your invoice table
The query could include all fields from the invoice table
In the criteria row of the query for the field for the date, type the dates
for the records you wish to delete.
For example if you wanted to delete all invoices from December 10 to
December 12,
you would write between 10/12/2007 and 12/12/2007.

View the query in datasheet view and make sure it contains only the invoice
records you want to delete.
You can delete these records from the query.

If you wish to run the delete query from code, you will need to set the
query up as a delete query, then copy the SQL for the query and use it in
code behind a delete button on a form.

If this isn't what you want to do, post back.

Jeanette Cunningham
 
SIR ,
Exactly your advise suites my requirement
and advise please how to add the sum(quantity) of the deleted period back to
table please for further calculations
and one more problom is ike this please advise
kindly advise with the following
i want to have an query like this with vb
private sub button click()
docmd.runsql(select queryname.* into tablename from queryname where
queryname.field = fieldvalues;")
here queryname is an selectquery
tablename an new make table name
fieldvalues = recordsets of an table
i want have the query to run with all criteria fieldvalues in the table
for which kindly advise me how to use
FOREACH element IN table
NEXT element
and store all values in the new maketable

Jeanette Cunningham said:
Hi balu,

Here is one way to delete the invoice data.

Create a query based on your invoice table
The query could include all fields from the invoice table
In the criteria row of the query for the field for the date, type the dates
for the records you wish to delete.
For example if you wanted to delete all invoices from December 10 to
December 12,
you would write between 10/12/2007 and 12/12/2007.

View the query in datasheet view and make sure it contains only the invoice
records you want to delete.
You can delete these records from the query.

If you wish to run the delete query from code, you will need to set the
query up as a delete query, then copy the SQL for the query and use it in
code behind a delete button on a form.

If this isn't what you want to do, post back.

Jeanette Cunningham


balu said:
dear friends,
table [ invoice]
fields [invoiceid] number
" [date] date
" [ quantity] number
i would like to delete some data between the dates of my choice and i want
to add data of (sum of invoice.quantity) between the dates of my choice
to
the table invoice
purpose: to compact and keep the database size small at choice of user but
at the same time invoice.quantity will be summed up and added to the same
table for perfect opening and closing balence calculations
can any one please help me .
 
Back
Top