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 / March 2006

Tip: Looking for answers? Try searching our database.

IFF Statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gloria - 29 Mar 2006 20:28 GMT
Here is the scenario. I have a list of numbers and due dates. I need to
create a query and an IIF statement. The IIF statement has to say:

iif([number list]=**-****1, "12/31/2006")

number list    
12-23121      
32-12542      
42-12541

Than I have due dates:
all numbers ending on "1" due date is 12/31/2006
all numbers ending on "2" due date is 12/31/2007

My question is what wildcard can I use to remplace the "???" on my
expression? Or is there another way to complete my IIF statement?
Rick B - 29 Mar 2006 20:34 GMT
Just use the "Right" function to grab the right digit of a field.

It seems rather odd to use a digit in a number to represent a due date,
though.

Signature

Rick B

> Here is the scenario. I have a list of numbers and due dates. I need to
> create a query and an IIF statement. The IIF statement has to say:
[quoted text clipped - 12 lines]
> My question is what wildcard can I use to remplace the "???" on my
> expression? Or is there another way to complete my IIF statement?
Gloria - 29 Mar 2006 20:55 GMT
Thanks for your help

> Just use the "Right" function to grab the right digit of a field.
>
[quoted text clipped - 17 lines]
> > My question is what wildcard can I use to remplace the "???" on my
> > expression? Or is there another way to complete my IIF statement?
Tom Ellison - 29 Mar 2006 20:37 GMT
Dear Gloria:

Your "number list" contains strings.  You want to look at the last
character.  Use Right([number list], 1) to get this.  Convert that to an
integer like this:

CInt(Right([number list], 1))

Use DateAdd to add this many years to 12/31/2005.

DateAdd("yyyy", CInt(Right("12-99997", 1)), CDate("12/31/2005"))

This yields12/31/2012

Sound good?

Tom Ellison

> Here is the scenario. I have a list of numbers and due dates. I need to
> create a query and an IIF statement. The IIF statement has to say:
[quoted text clipped - 12 lines]
> My question is what wildcard can I use to remplace the "???" on my
> expression? Or is there another way to complete my IIF statement?
Gloria - 29 Mar 2006 20:55 GMT
Thanks for your help

> Dear Gloria:
>
[quoted text clipped - 30 lines]
> > My question is what wildcard can I use to remplace the "???" on my
> > expression? Or is there another way to complete my IIF statement?
mscertified - 29 Mar 2006 20:41 GMT
You could use the RIGHT$ function e.g.
IIF(RIGHT$(CStr(MyNumber),1)="1",...,...)

-Dorian

> Here is the scenario. I have a list of numbers and due dates. I need to
> create a query and an IIF statement. The IIF statement has to say:
[quoted text clipped - 12 lines]
> My question is what wildcard can I use to remplace the "???" on my
> expression? Or is there another way to complete my IIF statement?
Gloria - 29 Mar 2006 20:55 GMT
Thanks for your help

> You could use the RIGHT$ function e.g.
> IIF(RIGHT$(CStr(MyNumber),1)="1",...,...)
[quoted text clipped - 17 lines]
> > My question is what wildcard can I use to remplace the "???" on my
> > expression? Or is there another way to complete my IIF statement?
Gloria - 29 Mar 2006 21:00 GMT
thanks for your help

> You could use the RIGHT$ function e.g.
> IIF(RIGHT$(CStr(MyNumber),1)="1",...,...)
[quoted text clipped - 17 lines]
> > My question is what wildcard can I use to remplace the "???" on my
> > expression? Or is there another way to complete my IIF statement?
 
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.