A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IIF FUNCTION



 
 
Thread Tools Display Modes
  #1  
Old July 31st, 2007, 06:44 PM posted to microsoft.public.access.reports
Renee
external usenet poster
 
Posts: 342
Default IIF FUNCTION

I HAVE A REPORT THAT BRINGS UP INFORMATION BASED ON A FIELD CALLED 'LOADER',
I ALSO HAVE ANOTHER FIELD CALLED 'SCALE DESCRIPTION' IN THE QUERY FOR THIS
REPORT. I WANT THE REPORT TO DISPLAY THE UNIT LISTED UNDER 'LOADER' ONLY IF
THE FIELD 'SCALE DESCRIPTION' IS BLANK, IF IT IS NOT BLANK THEN I WANT IT TO
SHOW ME THE UNIT LISTED UNDER 'SCALE DESCRIPTION' INSTEAD. IS THIS POSSIBLE?
  #2  
Old July 31st, 2007, 07:29 PM posted to microsoft.public.access.reports
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default IIF FUNCTION

I usually do this in the query itself:

SELECT T.[Loader], T.[Scale Description],
IIf(Len(T.[Loader] & "")0, T.[Loader], T.[Scale Description])
AS ValueToShow
FROM TableName AS T;

Bind the textbox in the report to the ValueToShow field.

--

Ken Snell
MS ACCESS MVP


"Renee" wrote in message
...
I HAVE A REPORT THAT BRINGS UP INFORMATION BASED ON A FIELD CALLED
'LOADER',
I ALSO HAVE ANOTHER FIELD CALLED 'SCALE DESCRIPTION' IN THE QUERY FOR THIS
REPORT. I WANT THE REPORT TO DISPLAY THE UNIT LISTED UNDER 'LOADER' ONLY
IF
THE FIELD 'SCALE DESCRIPTION' IS BLANK, IF IT IS NOT BLANK THEN I WANT IT
TO
SHOW ME THE UNIT LISTED UNDER 'SCALE DESCRIPTION' INSTEAD. IS THIS
POSSIBLE?



  #3  
Old July 31st, 2007, 08:20 PM posted to microsoft.public.access.reports
Renee
external usenet poster
 
Posts: 342
Default IIF FUNCTION

I AM NOT SURE I UNDERSTAND WHERE I WOULD PUT THAT IN THE QUERY

"Ken Snell (MVP)" wrote:

I usually do this in the query itself:

SELECT T.[Loader], T.[Scale Description],
IIf(Len(T.[Loader] & "")0, T.[Loader], T.[Scale Description])
AS ValueToShow
FROM TableName AS T;

Bind the textbox in the report to the ValueToShow field.

--

Ken Snell
MS ACCESS MVP


"Renee" wrote in message
...
I HAVE A REPORT THAT BRINGS UP INFORMATION BASED ON A FIELD CALLED
'LOADER',
I ALSO HAVE ANOTHER FIELD CALLED 'SCALE DESCRIPTION' IN THE QUERY FOR THIS
REPORT. I WANT THE REPORT TO DISPLAY THE UNIT LISTED UNDER 'LOADER' ONLY
IF
THE FIELD 'SCALE DESCRIPTION' IS BLANK, IF IT IS NOT BLANK THEN I WANT IT
TO
SHOW ME THE UNIT LISTED UNDER 'SCALE DESCRIPTION' INSTEAD. IS THIS
POSSIBLE?




  #4  
Old July 31st, 2007, 09:44 PM posted to microsoft.public.access.reports
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default IIF FUNCTION

Please do not use ALL CAPS -- it's interpreted as "shouting" in newsgroups.

What I provided is a sample SQL statement -- which is a query. Note the IIf
function in the third "field" in the statement; that is an example of how
this is done.

If you're using the grid design view to create a query, go to the first
empty column and click in the Field: box. Type this:

ValueToShow: IIf(Len([Loader] & "")0, [Loader], [Scale Description])

--

Ken Snell
MS ACCESS MVP



"Renee" wrote in message
...
I AM NOT SURE I UNDERSTAND WHERE I WOULD PUT THAT IN THE QUERY

"Ken Snell (MVP)" wrote:

I usually do this in the query itself:

SELECT T.[Loader], T.[Scale Description],
IIf(Len(T.[Loader] & "")0, T.[Loader], T.[Scale Description])
AS ValueToShow
FROM TableName AS T;

Bind the textbox in the report to the ValueToShow field.

--

Ken Snell
MS ACCESS MVP


"Renee" wrote in message
...
I HAVE A REPORT THAT BRINGS UP INFORMATION BASED ON A FIELD CALLED
'LOADER',
I ALSO HAVE ANOTHER FIELD CALLED 'SCALE DESCRIPTION' IN THE QUERY FOR
THIS
REPORT. I WANT THE REPORT TO DISPLAY THE UNIT LISTED UNDER 'LOADER'
ONLY
IF
THE FIELD 'SCALE DESCRIPTION' IS BLANK, IF IT IS NOT BLANK THEN I WANT
IT
TO
SHOW ME THE UNIT LISTED UNDER 'SCALE DESCRIPTION' INSTEAD. IS THIS
POSSIBLE?






  #5  
Old August 1st, 2007, 11:26 PM posted to microsoft.public.access.reports
Renee
external usenet poster
 
Posts: 342
Default IIF FUNCTION

Thank you very much, that works out wonderfully.

"Ken Snell (MVP)" wrote:

Please do not use ALL CAPS -- it's interpreted as "shouting" in newsgroups.

What I provided is a sample SQL statement -- which is a query. Note the IIf
function in the third "field" in the statement; that is an example of how
this is done.

If you're using the grid design view to create a query, go to the first
empty column and click in the Field: box. Type this:

ValueToShow: IIf(Len([Loader] & "")0, [Loader], [Scale Description])

--

Ken Snell
MS ACCESS MVP



"Renee" wrote in message
...
I AM NOT SURE I UNDERSTAND WHERE I WOULD PUT THAT IN THE QUERY

"Ken Snell (MVP)" wrote:

I usually do this in the query itself:

SELECT T.[Loader], T.[Scale Description],
IIf(Len(T.[Loader] & "")0, T.[Loader], T.[Scale Description])
AS ValueToShow
FROM TableName AS T;

Bind the textbox in the report to the ValueToShow field.

--

Ken Snell
MS ACCESS MVP


"Renee" wrote in message
...
I HAVE A REPORT THAT BRINGS UP INFORMATION BASED ON A FIELD CALLED
'LOADER',
I ALSO HAVE ANOTHER FIELD CALLED 'SCALE DESCRIPTION' IN THE QUERY FOR
THIS
REPORT. I WANT THE REPORT TO DISPLAY THE UNIT LISTED UNDER 'LOADER'
ONLY
IF
THE FIELD 'SCALE DESCRIPTION' IS BLANK, IF IT IS NOT BLANK THEN I WANT
IT
TO
SHOW ME THE UNIT LISTED UNDER 'SCALE DESCRIPTION' INSTEAD. IS THIS
POSSIBLE?






  #6  
Old August 2nd, 2007, 12:42 AM posted to microsoft.public.access.reports
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default IIF FUNCTION

You're welcome.

--

Ken Snell
MS ACCESS MVP


"Renee" wrote in message
news
Thank you very much, that works out wonderfully.

"Ken Snell (MVP)" wrote:

Please do not use ALL CAPS -- it's interpreted as "shouting" in
newsgroups.

What I provided is a sample SQL statement -- which is a query. Note the
IIf
function in the third "field" in the statement; that is an example of how
this is done.

If you're using the grid design view to create a query, go to the first
empty column and click in the Field: box. Type this:

ValueToShow: IIf(Len([Loader] & "")0, [Loader], [Scale Description])

--

Ken Snell
MS ACCESS MVP



"Renee" wrote in message
...
I AM NOT SURE I UNDERSTAND WHERE I WOULD PUT THAT IN THE QUERY

"Ken Snell (MVP)" wrote:

I usually do this in the query itself:

SELECT T.[Loader], T.[Scale Description],
IIf(Len(T.[Loader] & "")0, T.[Loader], T.[Scale Description])
AS ValueToShow
FROM TableName AS T;

Bind the textbox in the report to the ValueToShow field.

--

Ken Snell
MS ACCESS MVP


"Renee" wrote in message
...
I HAVE A REPORT THAT BRINGS UP INFORMATION BASED ON A FIELD CALLED
'LOADER',
I ALSO HAVE ANOTHER FIELD CALLED 'SCALE DESCRIPTION' IN THE QUERY
FOR
THIS
REPORT. I WANT THE REPORT TO DISPLAY THE UNIT LISTED UNDER 'LOADER'
ONLY
IF
THE FIELD 'SCALE DESCRIPTION' IS BLANK, IF IT IS NOT BLANK THEN I
WANT
IT
TO
SHOW ME THE UNIT LISTED UNDER 'SCALE DESCRIPTION' INSTEAD. IS THIS
POSSIBLE?








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.