Access - if function

  Gaz W 01:10 08 Dec 03

I have a query in Access made from a single table, which is fairly straightforard. This query displays every field in the table. I want to create a "virtual field" which uses the IF function. It needs to display, in this virtual field, the contents of another field IF the contents is greater than 39 (i.e. 40+), BUT if it is less than 40 (39 and below) it must display a zero, not the value of the field.

This is Access XP. I've tried Help but it's very confusing and never gives you exactly the answer you're looking for!

Any help will be much appreciated.


  LeadingMNMs 07:38 08 Dec 03

The basics of the If function in Access 2000 is something like this:


The IF statement in access is IIf. PLease replace Field1 with the correct field name, keeping the [ ]. The inequality maybe the wrong way round, not sure.

Hope this helps.

  AndyJ 08:43 08 Dec 03 on !

  Gaz W 10:18 08 Dec 03

Thanks very much. As AndyJ says it was spot on, except I had toi change it slightly because I found I needed to involve 3 cells, so now it's something more like this:


The main thing is it works.

Thanks very much for your help,


This thread is now locked and can not be replied to.

Surface Studio vs iMac 5K comparison review: Apple and Microsoft all-in-one PCs battle it out

1995-2015: How technology has changed the world in 20 years

Social media image sizes, specs and aspect ratios: the ultimate guide

New MacBook Pro release date, price and specs | New MacBook Pro 2016 announced: Now with Touch Bar…