Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

IF() function in query syntax

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hSiplu - 29 Jul 2006 14:25 GMT
hi,
I am looking for a function.
it's like IF() in MySQL.
suppose a table,

[sample_table]
memo, name, sex, amount
1, cust1, 'M',100
2, cust2, 'F', 200
3, cust2, 'F', 230
5, cust4, 'F', 460
6, cust1, 'M',70

In MySQL I would query "SELECT name, IF(sex='M','GUY','LADY') as type,
amount from sample_table where memo < 5";

and the result set,
name     type      amount
cust1     GUY     100
cust2     LADY    200
cust2     LADY    230
---------------------------------------------------------------------

now, I want this result set from that table.
what would be the equavalent query or IF() function in this case?

please help !
I am stuck,
Marshall Barton - 29 Jul 2006 14:42 GMT
>hi,
>I am looking for a function.
[quoted text clipped - 21 lines]
>now, I want this result set from that table.
>what would be the equavalent query or IF() function in this case?

IIF(sex='M','GUY','LADY') as type

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.