Skip to Content
author's profile photo Former Member
Former Member

SQL Query to show Customers in a particular Post Code area

Thanks to some help from the guys on the forum I came up with this very useful query. It shows BPs in a particular Post Code area and what they have bought. Very useful for our Sales Reps when they are out booking meetings

SELECT DISTINCT T2.[DocNum], T0.[CardCode], T0.[CardName], T1.[ZipCode], T2.[DocDate], T3.[Dscription]

FROM OCRD T0 INNER JOIN CRD1 T1 ON T0.CardCode = T1.CardCode INNER JOIN ORDR T2 ON T0.CardCode = T2.CardCode INNER JOIN RDR1 T3 ON T2.DocEntry = T3.DocEntry

WHERE T1.[ZipCode] like '[%0]%'

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 20, 2014 at 01:55 AM


    The query is also useful for marketing purpose.

    Keep on sharing the useful query here



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.