Grouped Query to Table

  • Thread starter gmenon100 via AccessMonster.com
  • Start date
G

gmenon100 via AccessMonster.com

Hello,

I have a access project which monitors invoices payment received. Each style
is a new record and 4-5 such records make up one invoice. i have grouped
these on a query to get a combined invoice total.

My question :

is it possible to move this grouped invoice to a new table (sumarized form).

the reason I need to do this is because i receive the payment in a lumpsum
with deductions and other charges which I cannot allocated to any single
record.

Is there any way, I can just put the amount paid against the combined records.


Any help is appreciated.

Gmenon
 
P

Pieter Wijnen

yes,
but it's better to write code (against your queries) to achieve you goal
the code however, would be someting like insert into sumtable(yourfields)
select yourfields from summarytable (+ criteria)

Pieter

gmenon100 via AccessMonster.com said:
Hello,

I have a access project which monitors invoices payment received. Each
style
is a new record and 4-5 such records make up one invoice. i have grouped
these on a query to get a combined invoice total.

My question :

is it possible to move this grouped invoice to a new table (sumarized
form).

the reason I need to do this is because i receive the payment in a lumpsum
with deductions and other charges which I cannot allocated to any single
record.

Is there any way, I can just put the amount paid against the combined
records.


Any help is appreciated.

Gmenon



--
 
G

gmenon100 via AccessMonster.com

Hi Pieter,

I am a novice and this seems too complicated, is it possible for you to
elaborate this.

Thank you for your response, highly appreciated.

Pieter said:
yes,
but it's better to write code (against your queries) to achieve you goal
the code however, would be someting like insert into sumtable(yourfields)
select yourfields from summarytable (+ criteria)

Pieter
[quoted text clipped - 18 lines]
 
P

Pieter Wijnen

try New Query, SQL Pane:

INSERT INTO InvoiceTotal (INVOICENO,TOTALAMOUNT)
SELECT A.INVOICENO, A.TOTALAMOUNT FROM YourGroupedQuery A
WHERE NOT EXISTS (SELECT 'X' FROM InvoiceTotal B
WHERE B.INVOICENO=A.INVOICENO)

Substituting Table/Field & Query Names For yours offcourse , Note that I "as
always" Alias the Tables in the Select Statement (A & B in this case)
You might want to substitute the WHERE clause with a Parameter instead ie

PARAMETERS Forms!YourForm!InvoiceNo Text;
INSERT INTO InvoiceTotal (INVOICENO,TOTALAMOUNT)
SELECT A.INVOICENO, A.TOTALAMOUNT FROM YourGroupedQuery A
WHERE A.INVOICENO = Forms!YourForm!InvoiceNo

If you (as you should) Add a unique index to InvoiceTotal (INVOICENO), You
can safely run it as often as you like <g>

HTH

Pieter

gmenon100 via AccessMonster.com said:
Hi Pieter,

I am a novice and this seems too complicated, is it possible for you to
elaborate this.

Thank you for your response, highly appreciated.

Pieter said:
yes,
but it's better to write code (against your queries) to achieve you goal
the code however, would be someting like insert into sumtable(yourfields)
select yourfields from summarytable (+ criteria)

Pieter
[quoted text clipped - 18 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top