View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
patrick molloy patrick molloy is offline
external usenet poster
 
Posts: 391
Default Excel-SQL Connect


sDate = _
Format$(Sheets("Table1").Range("A1"),"dd-mmm-yyyy")

sql="select * from database where date='" & sDate & "';"

note that (1) date is dd-mmm-yyyy and (2) is wrapped in
single quotes

Patrick Molloy
Microsoft Excel MVP




-----Original Message-----
Hi,

I have a little problem with my excel-SQL connection.

In one cell of my excel doc is a date. example 2003-11-04

I want to pass that date into my sql query.

select * from database where date="value from table1!A1"

is this possible?
I need a solution, so that the User in Excel can choose

the date and than
click run.

thx,
mike
.