Query syntax Access 2003

RobBhat

Registered User.
Local time
Today, 06:44
Joined
Sep 24, 2016
Messages
73
Hi All

I am so close to a solution that you have helped me towards. I am stuck at a syntax in a query. The following query works fine

SELECT QPostCodeCharges.Charge
FROM QPostCodeCharges
WHERE (((QPostCodeCharges.Courier_Company)=forms!FolCustDN!Cust_Transport_Company) And ((QPostCodeCharges.Service)=forms!FolCustDN!Cust_Delivery_Type) And ((QPostCodeCharges.PostCodePrefix)=forms!FolCustDN!Cust_DelPCode) And ((QPostCodeCharges.PalletNo)=forms!FolCustDN!Cust_Pallets));

But I want it to look compare the first 4 letters in the field forms!FolCustDN!Cust_DelPCode). I tried the following, but it doesnt accept the syntax:

((QPostCodeCharges.PostCodePrefix)=forms!FolCustDN!Left[Cust_DelPCode],4)


Can someone please help?

Thanks

Rob :)
 
Left is a function. You need to have parenthesis around its arguments.
 
Hi Plog

I tried the following but its not accepting:

((QPostCodeCharges.PostCodePrefix)=forms!FolCustDN !(Left[Cust_DelPCode],4))

Its not working. Could you give me the correct syntax please?

Thanks

Rob
 
Just off the top of my head:
QPostCodeCharges.PostCodePrefix=Left(forms!FolCustDN.Cust_DelPCode,4)
 
Hi it works!!...Thank you

the correct syntax is

(QPostCodeCharges.PostCodePrefix= Left(forms!FolCustDN.Cust_DelPCode,4))

:)
 

Users who are viewing this thread

Back
Top Bottom