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?