I have created a pass through query in an Access 2k database. The SQL syntax appears to be incorrect and I think I know why (but would like to confirm my thoughts and get some help as to how to correctly write the query).
Firstly, the query is using information from 5 ODBC tables which requires the user to log into the sql server to access the data. Under the Pass-Through queries properties I have entered the appropriate ODBC;DSN=***;SERVER=***;UID=***;PWD=***.
The query contains what I believe to be two errors..
1) I have an IIf statement: IIf([TableName].[Field]<>0,"Job Done","Call is Outstanding"
AS [Call Complete?]
As you can see this is a custom defined field.. (as Call Complete) and I'm not sure if this is one of my problems.. It is asking if there is a value greater than 0 in the table's field (which is numeric) then to return "Job Done" to the query field, otherwise return "Call is Outstanding".
2) The query is called from a form. On my form I have two unbound date fields. The query basically asked for the values in these dates fields to use as criteria for the query:
WHERE ((TableName.FieldDate) Between [Forms]![frmAccountReports]![txtDateFrom] And [Forms]![frmAccountReports]![txtDateUntil]));
If I remove both of these lines of the syntax the query will run, but for obvious reasons I would like to include them! Can anyone offer some help on this?
TIA
Firstly, the query is using information from 5 ODBC tables which requires the user to log into the sql server to access the data. Under the Pass-Through queries properties I have entered the appropriate ODBC;DSN=***;SERVER=***;UID=***;PWD=***.
The query contains what I believe to be two errors..
1) I have an IIf statement: IIf([TableName].[Field]<>0,"Job Done","Call is Outstanding"
As you can see this is a custom defined field.. (as Call Complete) and I'm not sure if this is one of my problems.. It is asking if there is a value greater than 0 in the table's field (which is numeric) then to return "Job Done" to the query field, otherwise return "Call is Outstanding".
2) The query is called from a form. On my form I have two unbound date fields. The query basically asked for the values in these dates fields to use as criteria for the query:
WHERE ((TableName.FieldDate) Between [Forms]![frmAccountReports]![txtDateFrom] And [Forms]![frmAccountReports]![txtDateUntil]));
If I remove both of these lines of the syntax the query will run, but for obvious reasons I would like to include them! Can anyone offer some help on this?
TIA