Select fields from table where datefield= ?
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.
Re: Select fields from table where datefield= ?
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