MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 16th, 2008, 11:01 AM
jh_dempsey jh_dempsey is offline
www.coastervideosonline.co.uk
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Leeds, UK
Posts: 43 jh_dempsey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 6 m 6 sec
Reputation Power: 5
Send a message via MSN to jh_dempsey
Question Wilcard search on "appended tables"

Hi All

I am working on creating a form in MS InfoPoint 2003 SP2

InfoPoint automatically creates the following code to join two tables together based on the proj_code field. (This code works fine and brings back the expected results set)

Code:
shape {select [proj_code],[proj_title],[proj_teamnames],[proj_sector],
[proj_reviewdate] from [projects] as [projects]} as [projects] 
append ({select [l_id],[proj_code],[l_section],[l_actionby],[l_targetdate],
[l_problem],[l_solution],[l_rank] from [lessons]} 
relate [proj_code] TO [proj_code]) as [lessons]


Now i want to do a wildcard search on the proj_title field, and this is what i tried (shown in bold):

Code:
shape {select [proj_code],[proj_title],[proj_teamnames],[proj_sector],
[proj_reviewdate] from [projects] as [projects]} as [projects] 
append ({select [l_id],[proj_code],[l_section],[l_actionby],[l_targetdate],
[l_problem],[l_solution],[l_rank] from [lessons]} 
relate [proj_code] TO [proj_code]) as [lessons] 
WHERE ([projects].[proj_title] LIKE "%test%")


This doesn't work and i get errors saying that there is an error somewhere around
Code:
"[lessons] WHERE ([projects].[proj_title]"


I have a basic knowledge of mySQL but none of MSSQL, so this has got me a bit stumped.

I have got to use the code that is in the first code snippet as this is what InfoPath provides, so please dont re-write a completely different sql statement as the answer (I would do it a lot different to this if i had the choice!!!).
The answer must be based on the statement format above, ideally just tagging some more "code" onto the end.

Anyone able to help??

PS
(I dont know what the "shape" is at the start of the sql statement, but its seems to be something that InfoPoint needs. Its definitely not the cause of the problem since the first snippet of code above works fine with it in.)

Last edited by jh_dempsey : July 16th, 2008 at 12:50 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Wilcard search on "appended tables" within InfoPoint 2003 SP2


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT