I keep getting type mismatch error with a query
SELECT * FROM [Log Watch] WHERE [Log Watch].EndDate=" & ReportDate &";
I am building this query in sql view of the query builder and clicking run to view the results. Keeps telling me type mismatch.
I keep getting type mismatch error with a query
SELECT * FROM [Log Watch] WHERE [Log Watch].EndDate=" & ReportDate &";
I am building this query in sql view of the query builder and clicking run to view the results. Keeps telling me type mismatch.
Don't need the concatenation and quote marks.
Build in Design view then switch to SQL view to see the statement.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Using VBA in a form module, you would use something like
Notice the delimiters...Code:strSQL = "SELECT * FROM [Log Watch] WHERE [Log Watch].EndDate= #" & Me.ReportDate &"#;"
In a saved query, you can't refer to the control "ReportDate" like that. It must be the fully qualified path.
Change Form1 to your form nameCode:SELECT * FROM [Log Watch] WHERE [Log Watch].EndDate= Forms!Form1.ReportDate;