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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|