I have never seen that error.
Can you open the query in Design View or SQL View?
Post the SQL statement for analysis.
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.
yes, I can open the query in design view
Sql
Code:SELECT customers.[Costumer Name], order.[Order ID], Last(payments.PYMDate) AS LastOfPYMDate, DateAdd('d',30,[PYMDate]) AS [Planned Payment], Abs(DateAdd('d',30,[PYMDate])-Date()) & " " & "Days" AS [Days Passed] FROM (customers INNER JOIN [order] ON customers.CustomerID = order.[Customer ID]) INNER JOIN payments ON order.[Order ID] = payments.[Order ID] GROUP BY customers.[Costumer Name], order.[Order ID], DateAdd('d',30,[PYMDate]), Abs(DateAdd('d',30,[PYMDate])-Date()) & " " & "]Days", customers.CustomerID HAVING (((DateAdd('d',30,[PYMDate]))<=Date()));
The Abs() expression in the GROUP BY has an extra ] in front of Days.
There is also an unnecessary concatenation in both of the Abs() expressions but that should not cause error.
Abs(DateAdd('d',30,[PYMDate])-Date()) & " Days"
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.
If there is a syntax or expression error, so why this error disappear sometimes ?
That looks like a MsgBox to me. Are you sure you are opening a query object?
I have no idea why the error would be intermittent.
Maybe use "d" instead 'd'.
That is SQL.
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.