• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

query Syntax

Hi all:
I've one table consists of 6 column (xdate, trno, servtype, vendor, customer, usersign).

first table
and 3 vendors table (tktvendor, bookingvendor, insuranceVendor).

i would like to join between the first table and the three vendors table according to field "servtype" value
if  servtype=1 i would like to join tktvendor
if  servtype=2 i would like to join bookingvendor
if  servtype=3 i would like to join insuranceVendor
khaled salem
khaled salem
  • 2
1 Solution
It looks like all fields in the Grid come from the first table.

Is that correct?
khaled salemSoftware DeveloperAuthor Commented:
No. I would like to join with vendorName in each table .
VendorName is not in the Grid, but you would like to include it, right?


Is join field vendor (Vendor #)?
From the few facts available, I think this may help:
FROM FIRST_TABLE AS FT --<< you didn't give this name
LEFT JOIN tktvendor       AS VS1 ON ft.vendor = vs1.vendor AND ft.servtype = 1
LEFT JOIN bookingvendor   AS VS2 ON ft.vendor = vs2.vendor AND ft.servtype = 2
LEFT JOIN insuranceVendor AS VS3 ON ft.vendor = vs13vendor AND ft.servtype = 3

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now