Declare a variable in ACCESS JET SQL

penmetsa

Registered User.
Local time
Today, 01:33
Joined
Aug 17, 2004
Messages
11
Hi,

Please look at the following code.

CREATE TABLE tblDeshome
(
[Destination_Purpose] TEXT(10) NULL,
Number_of_Trips INTEGER NULL,
Trip_Percentage INTEGER NULL
)
inth = Dcount("[PURPOSE]","trips","[PURPOSE] = '1' Or [PURPOSE] = '2'")
intw = Dcount("[PURPOSE]","trips","[PURPOSE] = '3'")
intsh = Dcount("[PURPOSE]","trips","[PURPOSE] = '8' Or [PURPOSE] = '9'")
intsc = Dcount("[PURPOSE]","trips","[PURPOSE] = '11'")
intoh = Dcount("[PURPOSE]","trips","[PURPOSE] = '4' Or [PURPOSE] ='5' Or [PURPOSE] = '6' Or [PURPOSE] = '7' Or [PURPOSE] = '10'")

INSERT INTO tblDeshome VALUES ('HOME',inth,intw)
INSERT INTO tblDeshome VALUES ('WORK',3,4)
INSERT INTO tblDeshome VALUES ('SHOPPING',4,5)
INSERT INTO tblDeshome VALUES ('SCHOOL',5,6)

I wanted to create a new table using SQL code.

I wanted to enter some calculated values by calculating from the "trips" query and field - "PURPOSE"

Using the above code I am getting an error saying - "Syntax error in CREATE TABLE statement"

How do I declare variables inth, intw .... using SQL code?

Please do me a favor.

Penmetsa
 

Users who are viewing this thread

Back
Top Bottom