Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Access 2000


Message #1 by "jolanta mazur" <jolanta_mazur@h...> on Thu, 20 Sep 2001 07:56:28
Hi

I want to insert values from the form into the table. I tried to use SQL 

query Insert Into (table) Values (...).

It doesn't work. Please help.

Yola



Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Thu, 20 Sep 2001 06:24:50 -0700
First, double-check your SQL INSERT INTO syntax by typing it manually into

the SQL view of a new query and running it from there.  If it works there,

post your code and maybe one of us will see the problem.



Cheers,



-Roy



-----Original Message-----

From: jolanta mazur [mailto:jolanta_mazur@h...]

Sent: Thursday, September 20, 2001 12:55 AM

To: Access

Subject: [access] Access 2000





Hi

I want to insert values from the form into the table. I tried to use SQL 

query Insert Into (table) Values (...).

It doesn't work. Please help.

Yola










Message #3 by "jolanta mazur" <jolanta_mazur@h...> on Fri, 21 Sep 2001 09:28:14
Hi Roy

This is my SQL Append query, which works, but what I had to do. I created 

another table based on the CustDate table, before running this query I had 

to create delete all records from the CustDate1.

It must be easy way to do it, and store in this same table - CustDate.

What do you think?

Many thanks

YOLA



1 Delete CustDate1.* From CustDate1



2 INSERT INTO CustDate1 ( ID, CustomerID, [Date], Adverts, LinageNo, [Size], 

MultiplaySize, Frequency, Price, Discount, DiscountValue, VAT, VATValue, 

Charge, Description, PayBy, Paid )

SELECT CustDate.ID, CustDate.CustomerID, CustDate.Date, CustDate.Adverts, 

CustDate.LinageNo, CustDate.Size, CustDate.MultiplaySize, 

CustDate.Frequency, CustDate.Price, CustDate.Discount, 

[Price]*[Discount]/100 AS DiscountValue, CustDate.VAT, 

([Price]-[DiscountValue])*[VAT]/100 AS VATValue, 

([Price]-[DiscountValue])+[VATValue] AS Charge, CustDate.Description, 

CustDate.PayBy, CustDate.Paid

FROM CustDate;





Message #4 by "John Ruff" <papparuff@c...> on Fri, 21 Sep 2001 07:13:41 -0700
What is the RecordSource for the form?



-----Original Message-----

From: jolanta mazur [mailto:jolanta_mazur@h...] 

Sent: Thursday, September 20, 2001 7:56 AM

To: Access

Subject: [access] Access 2000





Hi

I want to insert values from the form into the table. I tried to use SQL



query Insert Into (table) Values (...).

It doesn't work. Please help.

Yola







---

You are currently subscribed to access as: papparuff@c... To

unsubscribe send a blank email to $subst('Email.Unsub')





Message #5 by "Pardee, Roy E" <roy.e.pardee@l...> on Fri, 21 Sep 2001 15:18:52 -0700
If you want to do it in just one step, you should be able to do a SELECT

INTO statement like so:



   SELECT ID, CustomerID, Date, Adverts, 

   LinageNo, Size, MultiplaySize, 

   Frequency, Price, Discount, 

   [Price]*[Discount]/100 AS DiscountValue, VAT, 

   ([Price]-[DiscountValue])*[VAT]/100 AS VATValue, 

   ([Price]-[DiscountValue])+[VATValue] AS Charge, Description, 

   PayBy, Paid

   INTO CustDate1

   FROM CustDate;

   

HTH,



-Roy





Roy Pardee

Programmer/Analyst

SWFPAC Lockheed Martin IT

(xxx) xxx-xxxx



-----Original Message-----

From: jolanta mazur [mailto:jolanta_mazur@h...]

Sent: Friday, September 21, 2001 2:28 AM

To: Access

Subject: [access] RE: Access 2000





Hi Roy

This is my SQL Append query, which works, but what I had to do. I created 

another table based on the CustDate table, before running this query I had 

to create delete all records from the CustDate1.

It must be easy way to do it, and store in this same table - CustDate.

What do you think?

Many thanks

YOLA



1 Delete CustDate1.* From CustDate1



2 INSERT INTO CustDate1 ( ID, CustomerID, [Date], Adverts, LinageNo, [Size],



MultiplaySize, Frequency, Price, Discount, DiscountValue, VAT, VATValue, 

Charge, Description, PayBy, Paid )

SELECT CustDate.ID, CustDate.CustomerID, CustDate.Date, CustDate.Adverts, 

CustDate.LinageNo, CustDate.Size, CustDate.MultiplaySize, 

CustDate.Frequency, CustDate.Price, CustDate.Discount, 

[Price]*[Discount]/100 AS DiscountValue, CustDate.VAT, 

([Price]-[DiscountValue])*[VAT]/100 AS VATValue, 

([Price]-[DiscountValue])+[VATValue] AS Charge, CustDate.Description, 

CustDate.PayBy, CustDate.Paid

FROM CustDate;
Message #6 by "Carol Mandra" <carol_mandra@r...> on Mon, 24 Sep 2001 14:48:57
Yola, Try an update query in order to put values in an already existing

table:



UPDATE CustDate SET 

 DiscountValue = [Price]*[Discount]/100,

 VATValue= ([Price]-[DiscountValue])*[VAT]/100,

Charge = ([Price]-[DiscountValue])+[VATValue];



Carol ;-)



> Hi Roy  This is my SQL Append query, which works, but what I had to do. 

I created another table based on the CustDate table, before running this 

query I had to create delete all records from the CustDate1.

> It must be easy way to do it, and store in this same table - CustDate.

> What do you think?  Many thanks  YOLA

> 

> 1 Delete CustDate1.* From CustDate1 

> 2 INSERT INTO CustDate1 ( ID, CustomerID, [Date], Adverts, LinageNo, 

[Size], MultiplaySize, Frequency, Price, Discount, DiscountValue, VAT, 

VATValue, Charge, Description, PayBy, Paid)  SELECT ID, CustomerID, Date, 

Adverts, LinageNo, Size, MultiplaySize, Frequency, Price, Discount, 

> [Price]*[Discount]/100 AS DiscountValue, VAT, 

> ([Price]-[DiscountValue])*[VAT]/100 AS VATValue, 

> ([Price]-[DiscountValue])+[VATValue] AS Charge, Description, PayBy,Paid

> FROM CustDate; 


  Return to Index