Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To work around this behavior and query the date/time field in an Access database, generate the database results region and then modify the code to pass a date/time value. You will need to change the apostrophes to number signs in the SQL SELECT statement. To do this, follow these steps.
NOTE: The following procedure demonstrates how to do this by using the Employees table in the Northwind database. You will need to substitute your database, table, and code for that shown in this procedure.
- On the Insert menu, point to Database, and then click Results.
- Click Use a sample database connection (Northwind), and then click Next.
- Click Record source. In the Record source list, click Employees. Click Next.
- Click More Options.
- In the More Options dialog box, click Criteria.
- In the Criteria dialog box, click Add.
- In the Add Criteria dialog box, perform the following:
- In the Field Name list, click HireDate.
- In the Comparison list, click Equals.
- In the Value box, type HireDate if it doesn't appear by default.
- Click OK.
- Click OK two more times.
- Click Next two times.
- Click Finish.
- After the wizard has finished, click the HTML tab at the bottom of the FrontPage window.
- On the Edit menu, click Find. In the Find What box, type the following:
s-sql="SELECT * FROM Employees WHERE (HireDate = '::HireDate::')"
- Change each apostrophe (') to a number sign (#), so that it looks similar to this:
s-sql="SELECT * FROM Employees WHERE (HireDate = #::HireDate::#)"