Question : How to correctly format a date into SQL Query

HI

I would like to know how to correctly pass a date (without time) to an SQL Query, using access database.
As you can see in the attached code, my asp.net app is triggering a syntax error because the time included in the string.

Regards!
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
Dim hoy As Date = Date.Today.Date
 
            'Crea el comando
            cmd = New OleDbCommand
            cmd.Connection = con
            cmd.CommandText = "SELECT FINICIO_PROMOCION, FFINAL_PROMOCION, ESTATUS " & _
                              "FROM PRODUCTOS " & _
                              "WHERE (((FINICIO_PROMOCION)>=#" & hoy.ToString & "#) AND ((FFINAL_PROMOCION)<=#" & hoy.ToString & "#) AND ((ESTATUS)='PROMOCION'))"

Answer : How to correctly format a date into SQL Query

Code
   Dim d As DateTime = Now
   Debug.WriteLine(d.ToLongDateString)
   Debug.WriteLine(d.ToShortDateString)
   Debug.WriteLine(d.ToString("d"))
   Debug.WriteLine(d.ToString("yyyy-MM-dd"))
Results
Wednesday, December 10, 2008
12/10/2008
12/10/2008
2008-12-10
Random Solutions  
 
programming4us programming4us