MaliciousMike
Registered User.
- Local time
- Today, 17:42
- Joined
- May 24, 2006
- Messages
- 118
Here's my query.
Three expressions (Number1, Number2 and Number3), make up 'Reject'
If all three expressions are 1, then reject = 1.
Any other combinations will make reject = 0.
When i view the queery as it is up there, it works fine and shows everything absolutely perfectly.
When I want to view all records where 'Reject' = 0, it asks me what the expressions are. (see attachment)
I have no idea why this is happening.
Any light on why, and how to resolve it would be sweet!
Thanks.
Code:
[COLOR="Red"]SELECT[/COLOR]
CheckFieldSheet.[Company Name]
IIf([CheckFieldSheet].[Phone Number 1 *]=[tbl_clients].[Phone Number 1 *] Or [CheckFieldSheet].[Phone Number 1 *]=[tbl_clients].[Phone Number 2 *] Or [CheckFieldSheet].[Phone Number 1 *]=[tbl_clients].[Phone Number 3 *],1,(IIf(IsNull([CheckFieldSheet].[Phone Number 1 *]) And IsNull([tbl_clients].[Phone Number 1 *]),1,0))) AS [COLOR="Blue"]Number1[/COLOR],
CheckFieldSheet.[Phone Number 1 *], tbl_clients.[phone number 1 *],
IIf([CheckFieldSheet].[Phone Number 2 *]=[tbl_clients].[Phone Number 1 *] Or [CheckFieldSheet].[Phone Number 2 *]=[tbl_clients].[Phone Number 2 *] Or [CheckFieldSheet].[Phone Number 2 *]=[tbl_clients].[Phone Number 3 *],1,(IIf(IsNull([CheckFieldSheet].[Phone Number 2 *]) And IsNull([tbl_clients].[Phone Number 2 *]),1,0))) AS [COLOR="Blue"]Number2[/COLOR],
CheckFieldSheet.[Phone Number 2 *], tbl_clients.[phone number 2 *],
IIf([CheckFieldSheet].[Phone Number 3 *]=[tbl_clients].[Phone Number 1 *] Or [CheckFieldSheet].[Phone Number 3 *]=[tbl_clients].[Phone Number 2 *] Or [CheckFieldSheet].[Phone Number 3 *]=[tbl_clients].[Phone Number 3 *],1,(IIf(IsNull([CheckFieldSheet].[Phone Number 3 *]) And IsNull([tbl_clients].[Phone Number 3 *]),1,0))) AS [COLOR="Blue"]Number3[/COLOR],
CheckFieldSheet.[Phone Number 3 *], tbl_clients.[phone number 3 *],
IIf([Number1]=1 And [Number2]=1 And [Number3]=1,1,0) AS [COLOR="Blue"]Reject[/COLOR]
[COLOR="Red"]FROM[/COLOR]
tbl_clients
[COLOR="Red"]INNER JOIN[/COLOR]
CheckFieldSheet ON (tbl_clients.[company name] = CheckFieldSheet.[Company Name]) AND
(tbl_clients.[Region Name] = CheckFieldSheet.RegionName) AND
(tbl_clients.[Site Name] = CheckFieldSheet.[Site Name]) AND
(tbl_clients.[Plot Number/name] = CheckFieldSheet.[Plot Number/Name]) AND
(tbl_clients.[Site Code] = CheckFieldSheet.[Site Code])
[COLOR="Red"]WHERE[/COLOR]
(((CheckFieldSheet.Returns)="Wrong Number"));
Three expressions (Number1, Number2 and Number3), make up 'Reject'
If all three expressions are 1, then reject = 1.
Any other combinations will make reject = 0.
When i view the queery as it is up there, it works fine and shows everything absolutely perfectly.
When I want to view all records where 'Reject' = 0, it asks me what the expressions are. (see attachment)
I have no idea why this is happening.
Any light on why, and how to resolve it would be sweet!
Thanks.