jeudi 23 juin 2016

Create an expression in ACCESS 2010

Thank you in advance! I'm a novice, so plain and simple explanations would greatly be appreciated. I really don't know what I'm doing, but I have grand concepts w/o any idea how to execute them.

I am creating an append query in Access 2010 and I want to identify Col_C as yes, if the word "red" appears in Col_B and everything else as no.

DESIRED RESULTS

Col_A Col_B Col_C

1______red_______y
2______blue______n
3______red_______y
4______green_____n
5______red blue___y

I don't know how to write the if then statement.

INSERT into TABLE1
SELECT [TABLE2].[Col_A], [TABLE2].[CoL_B]
IF [TABLE2].[Col_B] like "*red*" then add y to Col_C else n
FROM [TABLE2]

I know it's a bad attempt, but I've been researching and the explanations aren't clear enough for me to proceed.

Aucun commentaire:

Enregistrer un commentaire