Sql

paulcherianc

Registered User.
Local time
Today, 07:11
Joined
Aug 15, 2013
Messages
86
Whats wrong with this code: Can any one solve this please:

((Table1.Location)=[Enter Project Number]) AND ((Table1.EmployeeID)=IIf([Location]="0217",[Table1].[EmployeeID],[Table1].[EmployeeID]) And (Table1.EmployeeID)<>287 And (Table1.EmployeeID)<>183 And (Table1.EmployeeID)<>264));


Its not giving me the result. May be the issue with <>. Is there any alternative method for this. Plz advise.

Regards,

Paul C:banghead:
 
IIf([Location]="0217",[Table1].[EmployeeID],[Table1].[EmployeeID]) -

Results to [Table1].[EmployeeID] in any case?...
 
IIf([Location]="0217",[Table1].[EmployeeID],[Table1].[EmployeeID]) -

Results to [Table1].[EmployeeID] in any case?...

Dear Marlan,

Plz find attached my database. When you run query1 input 0217 and the result will be blank and if you try 0221 you can see all data including "075" (Empno).

Actually what i need is to exclude Empno ("075") from table1 entries when i input 0217 as project number and should see all other entries related to 0217. In this query i used IIf([Table1].[Location]="0217",<>"075",Last([EmployeeMaster].[empno])) but it doesnt work!!

Could you please try to fix this.

Regards,

Paul Cherian
 

Attachments

Hi,

Maybe this?
((Table1.Location)=[Enter Project Number]) AND ((Table1.EmployeeID)<>IIf([Location]="0217","075",[Table1].[EmployeeID]+1) )

If you are trying to exclude, then exclude the result of the iif function when true, Else make sure the result will give a value that will never be excluded.

A is forever different than A+1, isn't it? (;
 
Hi,

Maybe this?
((Table1.Location)=[Enter Project Number]) AND ((Table1.EmployeeID)<>IIf([Location]="0217","075",[Table1].[EmployeeID]+1) )

If you are trying to exclude, then exclude the result of the iif function when true, Else make sure the result will give a value that will never be excluded.

A is forever different than A+1, isn't it? (;

Thanks a lot!!!:D Thanks Marlan!

It is fine now!! I used <>IIf([Location]="0217","075","")
 

Users who are viewing this thread

Back
Top Bottom