Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF statement in query 1

Status
Not open for further replies.

blackcat9000

Programmer
Feb 25, 2003
15
0
0
GB
Hi yer folks.

I have a form to showing a list of people who have paid membership fees for a year by having a value in the fees checkbox.

I am trying to provide a IIf statement or criteria to say if the year the fee was paid is not equal to the current year then change the fees checkbox value to false


IIf([feeyear]=Year(Now()),[Fees]=true,[fees]=false)

Can anyone help

Thanks in advance


 
It appears that you have the logic mixed up just a little.


IIF([feeyear]<>Year((Now()),[fees]=false,[fees]=true)


Hope this helps you,


Steve
 
You might try
[Fees]=IIf(([FeeYear]=Year(Now())),True,False)

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
why are u not trying to use &quot;case when&quot; in your query

i think it will helps u

thanks

saqib ashraf
 
Depends on what the database being used is doesn't it ?

If it's access i'm not sure that you can use 'case'.

Transcend
[gorgeous]
 
Any reason why you don't do a simple update query?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Sorry for not replying sooner guys.

It seems I did have my logics a little mixed up after all.

Thanks for showing the error of my ways as it now works perfectly.

Thanks again for the help.
 
Transend,

FYI - Access does support Case logic through VBA.

:)

Cheers,

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top