Adding field to query

G

gator

I want to use an IF statement to extract some digits from cell data. A cell
has a number like 90115 which represents 01/15/2009. I want to extract 9
from the cell into another cell so I can use a PIVOT Table more efficiently.
My question is where do I put the IF to make the extraction? The IF
stat5ement I have is
Year: IF(Len([myDate])=6,Left([myDate],2),Left([myDate],1)) which I have
located in a new field, as field name, in my query design. I get an error
saying Undefined function 'IF' in expression. Can someone help me?
 
J

Jerry Whittle

Access doesn't have cells.

Access doesn't have an IF function.

It does have an IIf function though which should do what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top