How do I get expression code help?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need the code for

If $$ in this column is > or = to 350000 then YES appears in the query.

Can anyone help???

Thanks so much!

Brian Lyons
Bakersfield California
 
You would get a much more useful answer if you would give the name of the
table and the field in question. However, assuming the table is called
MyTable and the field is called MyField, and your new column in the query is
called NewColumn, the expression (in the query builder) would look like
this:

NewColumn: IIF([MyField >= 350000, "YES")

In the SQL view, something like this:

SELECT *, IIF([MyField >= 350000, "YES") as NewColumn
FROM MyTable

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
I apologize. I am fairly new to using Access, and am still in the learning
stage. The dollar amount I need the expression based on is in the field "$
Loans" Basically the deal is, if my loan officers have reached 350000 in
loans for the month, I want a "YES" in a column so I know if they met their
goals.
I tried what you wrote but it is still giving me the message:
"The expression you entered contains invalid syntax"
Please help!
Roger Carlson said:
You would get a much more useful answer if you would give the name of the
table and the field in question. However, assuming the table is called
MyTable and the field is called MyField, and your new column in the query is
called NewColumn, the expression (in the query builder) would look like
this:

NewColumn: IIF([MyField >= 350000, "YES")

In the SQL view, something like this:

SELECT *, IIF([MyField >= 350000, "YES") as NewColumn
FROM MyTable

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L

Brian Lyons said:
I need the code for

If $$ in this column is > or = to 350000 then YES appears in the query.

Can anyone help???

Thanks so much!

Brian Lyons
Bakersfield California
 
My apologies as well. In my haste, I mis-typed. Try:

GoalReached: IIF([$ Loans] >= 350000, "YES")

What was missing was the closing bracket.

BTW, you would be better off NOT using special characters or spaces in your
table or field names. They can cause problems down the road.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L

Brian Lyons said:
I apologize. I am fairly new to using Access, and am still in the learning
stage. The dollar amount I need the expression based on is in the field "$
Loans" Basically the deal is, if my loan officers have reached 350000 in
loans for the month, I want a "YES" in a column so I know if they met their
goals.
I tried what you wrote but it is still giving me the message:
"The expression you entered contains invalid syntax"
Please help!
Roger Carlson said:
You would get a much more useful answer if you would give the name of the
table and the field in question. However, assuming the table is called
MyTable and the field is called MyField, and your new column in the query is
called NewColumn, the expression (in the query builder) would look like
this:

NewColumn: IIF([MyField >= 350000, "YES")

In the SQL view, something like this:

SELECT *, IIF([MyField >= 350000, "YES") as NewColumn
FROM MyTable

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L

Brian Lyons said:
I need the code for

If $$ in this column is > or = to 350000 then YES appears in the query.

Can anyone help???

Thanks so much!

Brian Lyons
Bakersfield California
 
It worked!! Thank you so much!! My boss is going to give me a raise!

Roger Carlson said:
My apologies as well. In my haste, I mis-typed. Try:

GoalReached: IIF([$ Loans] >= 350000, "YES")

What was missing was the closing bracket.

BTW, you would be better off NOT using special characters or spaces in your
table or field names. They can cause problems down the road.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L

Brian Lyons said:
I apologize. I am fairly new to using Access, and am still in the learning
stage. The dollar amount I need the expression based on is in the field "$
Loans" Basically the deal is, if my loan officers have reached 350000 in
loans for the month, I want a "YES" in a column so I know if they met their
goals.
I tried what you wrote but it is still giving me the message:
"The expression you entered contains invalid syntax"
Please help!
Roger Carlson said:
You would get a much more useful answer if you would give the name of the
table and the field in question. However, assuming the table is called
MyTable and the field is called MyField, and your new column in the query is
called NewColumn, the expression (in the query builder) would look like
this:

NewColumn: IIF([MyField >= 350000, "YES")

In the SQL view, something like this:

SELECT *, IIF([MyField >= 350000, "YES") as NewColumn
FROM MyTable

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L

I need the code for

If $$ in this column is > or = to 350000 then YES appears in the query.

Can anyone help???

Thanks so much!

Brian Lyons
Bakersfield California
 
Back
Top