Query syntax Access 2003 (1 Viewer)

RobBhat

Registered User.
Local time
Yesterday, 16:58
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 :)
 

plog

Banishment Pending
Local time
Yesterday, 18:58
Joined
May 11, 2011
Messages
11,636
Left is a function. You need to have parenthesis around its arguments.
 

RobBhat

Registered User.
Local time
Yesterday, 16:58
Joined
Sep 24, 2016
Messages
73
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
 

Tieval

Still Clueless
Local time
Today, 00:58
Joined
Jun 26, 2015
Messages
475
Just off the top of my head:
QPostCodeCharges.PostCodePrefix=Left(forms!FolCustDN.Cust_DelPCode,4)
 

RobBhat

Registered User.
Local time
Yesterday, 16:58
Joined
Sep 24, 2016
Messages
73
Hi it works!!...Thank you

the correct syntax is

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

:)
 

Users who are viewing this thread

Top Bottom