close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search Results getting messed up with INNER JOIN

Thread began 7/01/2009 9:12 pm by terencepjf260961 | Last modified 10/14/2009 7:28 am by Ray Borduin | 2995 views | 6 replies |

terencepjf260961

Search Results getting messed up with INNER JOIN

Hi; I built the search results pages with DA and then modified the SQL to use an inner join to get more meaningful info to display in the results view.

I had to alias 2 fields, but the search fails when I select either of these options... centerid and contact

contactinstores_search.asp

The issues are:
1) Selecting either the centerid or contact give me a 500 error
2) The Default Store checkbox behaves strangely (the field is a char & I tried several combinations of default values
3) How do I get ALL the results without selecting any search criteria?

Modified SQL ...

SELECT dbo.contactinStores.id as ID, dbo.GPCWebViewCust1.CustName, dbo.contact.name, dbo.contactinStores.centerid as centerid, dbo.contactinStores.contactid as contactid, dbo.contactinStores.defaultstore as defaultstore
FROM dbo.contact INNER JOIN dbo.contactinStores ON dbo.contact.contactid = dbo.contactinStores.contactid INNER JOIN dbo.GPCWebViewCust1 ON dbo.contactinStores.centerid = dbo.GPCWebViewCust1.CenterID

Thanks in advance

Sign in to reply to this post

Ray BorduinWebAssist

1) Probably because those column names you are filtering with aren't unique in the query. Try updating the code by hand to use contactinStores.centerid and contactinStores.contactid and it will probably fix that problem.

2) it isn't a checkbox now... You may have adjusted the page so I'm not sure if you are still having issues with this portion.

3) this should be the default functionality. I think you aren't getting all the results because of your last select field not having the correct option value for the first option:

<select name="S_defaultstore" id="S_defaultstore">
<option selected="selected">All</option>



should be:

<select name="S_defaultstore" id="S_defaultstore">
<option value="" selected="selected">All</option>
Sign in to reply to this post
Did this help? Tips are appreciated...

terencepjf260961

No Luck

Thanks Ray; I have tried and re-tried most of today with no luck! I used diffreent alias but the DA Search dialog always selects BOTH fields and defaults the type to List.

I tried qualifying the field as you suggested and it does not filter the recordset.

I tried using a different alias name - the recordset shows the right alias, but DA Search still brings in the table fields.

It seems to me that DA Search does not consider the alias name and pulls in the unqualified field names instead.

What do you recommend I do in this case?

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

Please post a support incident. Somebody will need to look into it further with you.

Sign in to reply to this post
Did this help? Tips are appreciated...

terencepjf260961

Thanks Ray; your post for the INNER Join and Russell's pointers for the checkbox worked - finally! after 3 days of playing around with the DA Search feature - so many gotcha's !!

It was a good learning experience though.

Just to highlight the areas:
1) Alias your tables and TEST out the raw SQL
2) Run the default DA wizard
3) Update your search page - checkboxes and/or Radio groups (I did the radio group only because I could set the checked/unchecked defaults or default your database column to N|0
4) Update your results page Recordset - paste your aliased SQL code and TEST - note the column name if you have aliased those too!
5) Update your DA Search - this is the crux of the problem; if you have 2 key fields like I did with the same name - BOTH will be selected and this will not work. Also make sure the COLUMN TYPE and Filter TYPE are correctly selected for your search needs
6) Modify the DA Search code (BuildFromList) parameters to reference the ALIASED fields - VERY IMPORTANT!
7) Modify the form fields to reference the aliased columns too

Thanks again to Ray & Russell

Sign in to reply to this post

info315909

Hi, I am having almost the exact same issue as was described in this thread - Inner joins and DataAssist Search not playing together.

Could you please open a support ticket for me to resolve the issue. (Was not enough detail in the final post to determine how the issue was actually resolved).




DataAssist Version: 2.0.6

Sign in to reply to this post

Ray BorduinWebAssist

I have gone ahead and opened up a support incident for you. Please update it with a good phone number and time to call.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...