View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ward376 ward376 is offline
external usenet poster
 
Posts: 360
Default Change Excel query with a inputbox

You want to use a parameter for the date. You can only use parameters
in Query, not in the Query Wizard.

instead of: WHERE (ae_dt1.field4='2008-05-02')
try: WHERE (ae_dt1.field4=?)
Excel should prompt the user for the criteria value (parameter).

To create a parameter in the msquery interface, use square brackets
(with or without a default) as the value for the date field criteria.
To create a parameter in the sql statment, substitute a question mark
for the date value.

Cliff Edwards