between querie

JonyBravo

Registered User.
Local time
Today, 19:41
Joined
Jan 17, 2006
Messages
89
Hi there

I've got the following query in my application:
SQL = "INSERT INTO tblreport3 ( exchange, NoCustomers2, [time] )"
SQL = SQL & "SELECT Table1.Exchange1, Table1.Customers1, Table1.Duration"
SQL = SQL & "FROM Table1"
SQL = SQL & "WHERE (Table1.IncStart Between #txtdatefrom# And #txtdateto#);"
DoCmd.RunSQL (SQL)

The problemis when I run the application it gives me a error 3075 saying missing operator in query expression.

Can someone please tell me what is missing here?

Thansk
 
You aren't giving it spaces between the parts so it is running together. For example, your first two lines, if put together into one would end up looking like:

"INSERT INTO tblreport3 ( exchange, NoCustomers2, [time] )SELECT Table1.Exchange1, Table1.Customers1, Table1.Duration"

But you need a space between the ) and the SELECT

Each line you have to remember to add a space either at the end of the line (the easiest) or at the beginning (all but the first line if you do this one).
 

Users who are viewing this thread

Back
Top Bottom