sql code for Append Qry (1 Viewer)

mrrayj60

Registered User.
Local time
Today, 07:19
Joined
Sep 3, 2009
Messages
103
I need some help adding records from one table to another. I want to add a record for a date range the user enters. The fields from VRC would be added to VRC Fines would be duplicated except for one, Finedate. That field would be for the dates the user inputs. He enters 01/01/10 - 01/07/10 would be 7 appends each new append would have a unique date between 1/1 and 1/7. I think what I need is a stored value and the value is the date range. Can anyone help? Thanks, Ray, access2003

Here is my code that does not work.
INSERT INTO vrcfines ( ubl, Name, [vrccase#], complaintid, complaint, fineamnt, finedate )
SELECT vrc.UBL, vrc.NAME, vrc.[VRCCase#], vrc.Complaintid, vrc.COMPLAINT, vrc.Fine, xdate AS Expr1
FROM vrc
WHERE (((vrc.Complaintid)=132) AND xdate = ((xdate) Between [xdate] And [xdate]));
 

llkhoutx

Registered User.
Local time
Today, 06:19
Joined
Feb 26, 2001
Messages
4,018
Change
PHP:
...vrc.Fine, xdate AS Expr1...
to
PHP:
...vrc.fine as fineamnt, xdate AS finedate...
 

llkhoutx

Registered User.
Local time
Today, 06:19
Joined
Feb 26, 2001
Messages
4,018
Change
PHP:
...vrc.Fine, xdate AS Expr1...
to
PHP:
...vrc.fine as fineamnt, xdate AS finedate...
This is a Query question, not a SQL Server question.
 

stonemethew

New member
Local time
Today, 04:19
Joined
Mar 12, 2010
Messages
3
My usual approach is to create and save the pass-through query, then create a second query which uses the pass-through as a data source and does the append. Then you have no confusion as to which environment you're in -- and you can re-map data using local Access tables if necessary.
 

Users who are viewing this thread

Top Bottom