 |
|
 |
|
Next: Many To Many Relationships
|
| Author |
Message |
External

Since: Mar 24, 2007 Posts: 2
|
(Msg. 1) Posted: Mon Apr 16, 2007 9:57 am
Post subject: Posting linked records Archived from groups: microsoft>public>vb>database>dao (more info?)
|
|
|
I was brought up with dBase, and now need advice on how to post linked
records using DAO & SQL. Though I could do a kludge for this, I want to know
to do this simply and efficiently.
I need to use DAO to post to a non-SQL system, where I calculate totals for
a group of detail records, then post this to a header record on the non-SQL
system, followed by detail records taking values from the detail records. I
am OK with posting to the non-SQL system, but want to know how to easily
code the SQL/DAO part.
I used this code to calculate the data for the header records from the
detail records:
SELECT szAccount, szTranRef, dDate, szvalidationComment,sum(dblNetAmount) AS
[dblTotalReceived]
FROM import
GROUP BY szAccount, szTranRef, dDate, szvalidationComment
Many thanks
David >> Stay informed about: Posting linked records |
|
| Back to top |
|
 |  |
External

Since: Jun 14, 2006 Posts: 18
|
(Msg. 2) Posted: Tue Apr 17, 2007 4:55 am
Post subject: Re: Posting linked records [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
David Bernheim wrote:
> I was brought up with dBase, and now need advice on how to post linked
> records using DAO & SQL. Though I could do a kludge for this, I want
> to know to do this simply and efficiently.
>
> I need to use DAO to post to a non-SQL system, where I calculate
> totals for a group of detail records, then post this to a header
> record on the non-SQL system, followed by detail records taking
> values from the detail records. I am OK with posting to the non-SQL
> system, but want to know how to easily code the SQL/DAO part.
>
> I used this code to calculate the data for the header records from the
> detail records:
> SELECT szAccount, szTranRef, dDate,
> szvalidationComment,sum(dblNetAmount) AS [dblTotalReceived]
> FROM import
> GROUP BY szAccount, szTranRef, dDate, szvalidationComment
Write it as two seperate INSERT statements. Generally, you would create the
header records, and then create the detail records.
--
Regards,
Michael Cole >> Stay informed about: Posting linked records |
|
| Back to top |
|
 |  |
| Related Topics: | Database corrupt error while posting large transactions - Hello, I am using VB6 application (very old) with an Access 97 database. The database is quite large (close to Access limit of 1G) and is used over the network from multiple location. >From time to time when I am committing a large transaction (wit...
Deleting records from DAO recordset - [posted earlier in other group] Hi All, I'm using the following code to delete one or more records from a DAO recordset. The code is working but I was wondering if I need to Update the recordset with: rsDel.Update? Public Function DelRecs(Lstview As....
Looping through Records question - Hi all, I have a table in access (tbl_ReportList) that has four fields (ID, Emailto, CC, and RptName). The email and CC fields both have e-mail addresses in them and the RptName field is a list of reports in the database. For now I only have three:..
Add new record in DAO recordset locks entire table (using .. - I'm having problem with using DAO recordset in MS Access 2000 to append record into a table. Following is the code: Dim wkSpace As Workspace, db As Database Dim rstTrans As DAO.Recordset Set wkSpace = DBEngine.Workspaces(0) Set db =..
strange! vb6+access2002 - I have a mdb called treesy.mdb.There is a table,named transcipt with three fields:serial_no, eng,sound serial_no:1-10 (10 numbers) eng: 1.The movie has been on for 15 minutes, madam.@ 2.Oh, my god!@ It's 7:45 now!@ 3.Is Helen coming?@ It¡¯s 6:50 now.@.. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|