Why does field name request parameter?

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
Code:
SELECT Choose(Mid([HDINVN],5,2),"January","February","March","April","May","June","July","August","September","October","November","December") AS [Month], HIST.CUADR1 AS Address, [CUCITY] & ", " & [custat] AS Location, IIf(Mid([HDCUNO],4,4)="1625",[BILLNAME],"Company X") AS Contractor, CStr([HDINVN]) AS Invoice, Left([HDCUNO],3) & "-" & Mid([hdcuno],4,4) & "-" & Right([hdcuno],7) AS Account, IIf(Left([hdcuno],3)="002" And [HDSYCD]<>"","Group " & Val(Right([HDSYCD],2)),"") AS [Container Group], HIST.HDSYCD, [HIST].[HDCTQT] & "-" & [HIST].[HDCTSZ] & [HIST].[HDVLCD] & " " & IIf([HIST].[HDPUDY] Is Null Or Len([HIST].[HDPUDY])-CharCount("-",[HIST].[HDPUDY])=0,"ON CALL",Len([HIST].[HDPUDY])-CharCount("-",[HIST].[HDPUDY]) & "x") AS [Service Level], HIST.HDHQTY AS [Number of Pull], IIf((Left([Invoice History Detail]![HDCUNO],3)="001" And Left([HDSYCD],1)="1") Or (Left([Invoice History Detail]![HDCUNO],3)="002" And Left([HDSYCD],1)="7"),"RECYCLE","TRASH") AS [Type of Service], HIST.HDTAMT AS Price, IIf([hdctyp]='02',[HDIDDT],0) AS haul, HIST.HDSLVL AS TONNAGE, HIST.HHSLOC, HIST.HDCTYP
FROM [Invoice History Detail] AS HIST LEFT JOIN [1625 Selective Cust qry] AS CUST ON HIST.HDCUNO = CUST.Acct
WHERE (((HIST.HDTAMT)<>0) AND (([HIST]![HHNANO])=[Enter CBS#]));

I don't understand why this query when I run it ask for the HDCUNO parameter? It is not a parameter field, it is just a field I have used within a calculated field. Does anyone see why?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
At first glance I see you are using HIST in some parts of the SQL and Invoice History Detail elsewhere.

Perhaps you need to be more consistent with that.
 
Upvote 0

Forum statistics

Threads
1,221,531
Messages
6,160,367
Members
451,642
Latest member
mirofa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top