dlookup syntax problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following Dlookup in a query which does not return the correct
result.

SD1: IIf([PolType]="19",DLookUp("[SD]","[TblCharges]","[Class] = " &
[PolType] And ' "[TransType] = " &
[TransType]'),[Premium]*DLookUp("[SD]","[TblCharges]","[Class] =" & [PolType]
And "[TransType] =" & [TransType])/100)

Class and Poltype are both numeric and TransType is text.

Could someone please tell me where I am going wrong.

Thanks

David
 
A text need a single quote before and after the parameters

Try this

SD1: IIf([PolType]="19",DLookUp("[SD]","[TblCharges]","[Class] = " &
[PolType] & " And [TransType] = '" & [TransType] &
"'"),[Premium]*DLookUp("[SD]","[TblCharges]","[Class] =" & [PolType] & " And
[TransType] = '" & [TransType] & "'")/100)
 
Back
Top