Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help..I am searching a specials functions

Status
Not open for further replies.

mgonzalez

Programmer
Aug 2, 2000
51
0
0
MX


Hello

Hello

I hope that someone coul help me...I am working whith a database in Access, and I need some functions.One is that I can use to show a field depending of the content of the field..for example if I have a field named cost I want that if the cost is major than 500 show the word "good" but if is minor must show "bad".I founded in the help of access a function with the name of silnm, but doesn't worked.

The other function thata I am searching is one that help me to extract a specifical string from a field somthing like the function mid() in Visual Basic.

Thanks


 

You can use the IIF function in a query to display a value based on another value.

Select Cost, IIF(Cost>=500,"Good","Bad")
From table

Use of IIF is not advisable in VBA code. Use a standard If.'. Then... Else statement instead.

If Cost>=500 Then
Print "Good"
Else
Print "Bad"
End If

You can use the Mid funcion in Access, both in a query and in VBA code.

-------------------

May I suggest that you post Access questions in an Access forum rather than the ANSI SQL forum. Access is not totally ANSI compliant. forum181 is good for general Access questions. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top