I have a query where I need Access to evaluate the "Name" field and return messages "Batch" or "Desktop". The "Name" field contains unique values like
A0612041843574124983.tif#http://fl-jax-sharp/sites% and
2006112200039CIN218.TIF#http://fl-jax-sharp/sites%
Values starting with A are "Desktop", starting with 2006 - "Batch"
I tried IIF expression
IIF([Name]="A*","Desktop", "Batch") and it did not work. My guess is that IIF can only work with exact values in the field (e.g. A, 2006) and cannot incorporate the "starts with" expression....
I also tried exporting the query results in Excel and using IF(A2=A06*,"Desktop", "Batch") and it does not work either for the same reason - it needs exact value and cannot deal with the values"starting with". Or maybe I just do not know and should use some other formula/expression.
I am very new with Access, mostly learning on the job. Please help.
Lena
4 9844
I have a query where I need Access to evaluate the "Name" field and return messages "Batch" or "Desktop". The "Name" field contains unique values like
A0612041843574124983.tif#http://fl-jax-sharp/sites% and
2006112200039CIN218.TIF#http://fl-jax-sharp/sites%
Values starting with A are "Desktop", starting with 2006 - "Batch"
I tried IIF expression
IIF([Name]="A*","Desktop", "Batch") and it did not work. My guess is that IIF can only work with exact values in the field (e.g. A, 2006) and cannot incorporate the "starts with" expression....
I also tried exporting the query results in Excel and using IF(A2=A06*,"Desktop", "Batch") and it does not work either for the same reason - it needs exact value and cannot deal with the values"starting with". Or maybe I just do not know and should use some other formula/expression.
I am very new with Access, mostly learning on the job. Please help.
Lena
'Create a Calculated Field and for its value set it to a Public Function with a Name Argument. Analyze the Name within the Function and return the appropriate result. The Calculated Field would look like:
Status: fAnalyzeName([Name]) 'Function returns correct Status based on Name passed to it
NOTE: If the need the Function & Code, please let me known. I'll be glad to
assist...
NeoPa 32,556
Expert Mod 16PB
Try : - IIF([Name] Like "A*","Desktop", "Batch")
or, if using ANSI-92 compatibility : - IIF([Name] Like "A%","Desktop", "Batch")
IIF([Name] Like "A*","Desktop", "Batch") (without a space before "Batch" WORKED!!!!
THANK YOU!
Lena
This is a little bit beyond my understanding of Access yet :) I tried to create a field, but it did not work for me....Anyways, the IIF function worked :)
'Create a Calculated Field and for its value set it to a Public Function with a Name Argument. Analyze the Name within the Function and return the appropriate result. The Calculated Field would look like:
Status: fAnalyzeName([Name]) 'Function returns correct Status based on Name passed to it
NOTE: If the need the Function & Code, please let me known. I'll be glad to
assist...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: John Baker |
last post by:
Hi:
As those who have looked at this newsgroup recently will realize, I am a neophyte with
Access, although I have experienced with Approach (the Lotus product). There are things I
could easily...
|
by: Randy Harris |
last post by:
I imported records into a table, later found out that many of them had
trailing spaces in one of the fields. If I'd caught it sooner, I could have
trimmed the spaces before the import.
This...
|
by: ED |
last post by:
I am currently developing a database that will spit out job completion
stats each day of a given month. I have a table that has lists the
number 1 through 31. I am using this as a static table. ...
|
by: rguarnieri |
last post by:
Hi!
I'm trying to create a query with a boolean expression like this:
select (4 and 1) as Value from Table1
this query return always -1, but when I make the same calculation in
visual...
|
by: leeg |
last post by:
Help please. Apologies but I am poor in access and programming :o) and am having trouble getting my head around this one!!...again!!!
I need to have a query or report to flag up someone who has...
|
by: Jo |
last post by:
Hi there,
I'm Jo and it's the first time I've posted here. I'm in process of creating
a database at work and have come a little unstuck.....I'm a bit of a novice
and wondered if anyone could...
|
by: Marc Gravell |
last post by:
In Linq, you can apparently get a meaningful body from and
expression's .ToString(); random question - does anybody know if linq
also includes a parser? It just seemed it might be a handy way to...
|
by: John |
last post by:
I have a table with amongst others 2 fields: DateIn and DateOut. The idea is
to make a chart that shows the average number of days it takes for a request
to be answered. I'm planning to make a...
|
by: RussCRM |
last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |