Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile error

Status
Not open for further replies.

primerov

Technical User
Aug 16, 2002
160
BG
Compile error

The following constant is wrongly made by me, and i get "Compile error" :

Public Const CnstUpdate as Date > #01/01/2003#

May i get some help?
I wanted to insert the constant into the following line:

StrCustomers = " SELECT customers.* INTO CustomersTemp FROM customers

WHERE Customers.LastUpdated > #01/01/2003#"




 
When declaring constant, you set its value using equals.

But if it is a constant, why not embed value in StrCustomers
as in your post - it should work.

However, if it can vary, use:
Public VarUpdate As Date
VarUpdate = #01/01/2003#
StrCustomers = " SELECT customers.* INTO CustomersTemp FROM customers
WHERE Customers.LastUpdated > #" & Format(VarUpdate, "mm/dd/yyyy") & "#"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top