Solved

IIF EQUALS A DASH

Posted on 2011-09-25
1
395 Views
Last Modified: 2012-05-12
I can not get Access to recognize a dash   I have tried everything I know and it still will not read it  The below is what I used on the latest try

Timeform: IIf([TIMEFORMCODE]="*-*",1,0)
0
Comment
Question by:JackJackson54
1 Comment
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 36595425
I assume this is in a query, and you are trying to set the value of the "Timeform" field to either 1 or zero. But from your description, you want it to be a 1 if [TimeFormCode] = "-", but your code is using wildcards, which implies that you want if [TimeFormCode] contains a dash, which is it?

If #1, then try:

Timeform: IIF([TIMEFORMCODE] = "-", 1, 0)

If #2, then try:

Timeform: IIF(instr([TIMEFORMCODE], "-") > 0 , 1, 0)



0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now