Click to See Complete Forum and Search --> : Select fields from table where datefield= ?


raghu_nv
June 14th, 2001, 03:37 AM
I want to read records from a table on a datefield value.
Regardless of database (Access ,SQL Server or Oracle) and local system date format setting , what is the Common syntax for SQL Statement.

1) select fields from table where billdate = ?

2) select fields from table where billdate betwen ? and ?

Thanks is advance.

Clearcode
June 14th, 2001, 03:47 AM
If you are using DAO then you need to use the access syntax:


Dim dtIn as date
ssql = "SELECT * FROM Table WHERE BILLDATE = #" & Format$(dtIn, "mm/dd/yyyy") & "#"




For RDO you use ' instead of #...

(Although I don't knowe for sure that this works onm Access as I don't use that erm database)

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com