Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have 2 list boxes bound to a database. The 1st list box displays services ordered by the customer. I want the 2nd list box to display services not yet ordered by the customer.

 

For example. My services are A, B, C, D and the customer has ordered A and B.

 

List box 1 should show A, B

List box 2 should show C,D

 

I have list box 1 working. Can someone give me some help as to how I need to setup the query for list box 2? Thanks for your help.

 

Weste

Posted

Problem Solved!

 

The query below solved by problem.

 

SELECT Services.ServiceID, Services.ServiceName

FROM Services

LEFT JOIN (SELECT ServiceSales.SalesID, ServiceSales.ServiceID FROM ServiceSales WHERE ServiceSales.SalesID = @Param1) AS B

ON Services.ServiceID = B.ServiceID

WHERE B.ServiceID Is Null

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...