By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

A query help

P: n/a
Hi All,

I a table with two columns:

ID Note
--- ------
1 Andy was paid on 4/5/04. He was working on the xxx project.
2 Tom was paid on 4/3/05. He was working on the xxx project.
3 Steve was working on the xxx project.
4 Cindy was paid on 11/12/05. She was working on the xxx
project.
5 Ben was working on the xxx project.
........

I need a query to display the following outcome based on the keyword
"paid" in the Note field:

ID ExpressionField
--- -----------------------
1 Paid
2 Paid
3 Unpaid
4 Paid
5 Unpaid

How can I make this query?

- Grasshopper -

Feb 9 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Something like this:

SELECT ID, IIf([Note] Like "*paid*"), "Paid", "Unpaid") AS ExpressionField
FROM Table1;

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"SQL Learner" <ex***********@gmail.comwrote in message
news:11**********************@m58g2000cwm.googlegr oups.com...
Hi All,

I a table with two columns:

ID Note
--- ------
1 Andy was paid on 4/5/04. He was working on the xxx project.
2 Tom was paid on 4/3/05. He was working on the xxx project.
3 Steve was working on the xxx project.
4 Cindy was paid on 11/12/05. She was working on the xxx
project.
5 Ben was working on the xxx project.
.......

I need a query to display the following outcome based on the keyword
"paid" in the Note field:

ID ExpressionField
--- -----------------------
1 Paid
2 Paid
3 Unpaid
4 Paid
5 Unpaid

How can I make this query?

- Grasshopper -
Feb 9 '07 #2

P: n/a
That works, Allen. Thank you so much! Have a great day!

- Grasshopper -

Feb 9 '07 #3

P: n/a
Allen Browne's post will work until someone enters

5 Ben was working on the xxx project and will be paid on 12/20/2005

I would think you need a check box or date paid field.

"SQL Learner" <ex***********@gmail.comwrote in message
news:11**********************@m58g2000cwm.googlegr oups.com...
Hi All,

I a table with two columns:

ID Note
--- ------
1 Andy was paid on 4/5/04. He was working on the xxx project.
2 Tom was paid on 4/3/05. He was working on the xxx project.
3 Steve was working on the xxx project.
4 Cindy was paid on 11/12/05. She was working on the xxx
project.
5 Ben was working on the xxx project.
.......

I need a query to display the following outcome based on the keyword
"paid" in the Note field:

ID ExpressionField
--- -----------------------
1 Paid
2 Paid
3 Unpaid
4 Paid
5 Unpaid

How can I make this query?

- Grasshopper -

Feb 9 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.