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 May 13th, 2004, 04:14 PM
got2bmvp got2bmvp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 got2bmvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
A little Newbie help

Hello everyone,

I am new to SQL and was wondering if any of you could offer advice for the following problem. I have 4 tables in Access, they are listed below:

Table1
StyleID AttID AttributeValue
1 1 (a)
1 2 72
1 3 0
1 4 0
1 5 0
1 6 0
2 1 <Null>
2 2 72
2 3 0
2 4 36
2 5 3
2 6 0
2 7 12
3 1 <Null>
3 2 0
3 3 0
3 4 0
3 5 0
3 6 0
3 7 0

Table2
ID StyleName StyleType StyleString
1 @Normal 2
2 "_1.0sp 0.5""" 1
3 _Author Data Left 2

Table3
TypeID AttributeID
1 1
1 2
1 3
1 4
1 5
2 2
2 3
2 4
2 5
2 7

What I would like to ultimately do is create a string value in Table 2 that would concatenate the applicable attribute values from table 1 based on the typeID and attributeID in table 3. It should look something like this:

ID StyleName StyleType StyleString
1 @Normal 2 72|0|0|0|
2 "_1.0sp 0.5""" 1 (a)|72|0|0|0|
3 _Author Data Left 2 0|0|0|0|

Any help would be appreciated! Thanks!

Last edited by got2bmvp : May 13th, 2004 at 09:25 PM.

Reply With Quote
  #2  
Old May 16th, 2004, 08:48 AM
shadowsurfer shadowsurfer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 19 shadowsurfer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i think you are going to have to use a JOIN command to join the tables when doing a query... maybe even a ... hmm. forget the term ... where you select portions of each table useing the join but it makes a seperate table not just a query
...I am new at this too... just a sugestion to try

Reply With Quote
  #3  
Old May 16th, 2004, 08:49 AM
shadowsurfer shadowsurfer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 19 shadowsurfer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
https://aurora.vcu.edu/db2help/db2y0/frm3toc.htm
this is an excellent site for any newb

Reply With Quote
  #4  
Old May 19th, 2004, 04:11 PM
got2bmvp got2bmvp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 got2bmvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Finally got it....

SELECT DISTINCT StyleAttributes.AttributeValue, Apply.AttributeID FROM StyleAttributes, StyleNames, Apply, Templates WHERE Apply.StyleTypeID = StyleNames.StyleTypeID AND StyleNames.ID = StyleAttributes.StyleNameID AND Apply.AttributeID = StyleAttributes.AttributeID AND StyleNames.StyleName = 'WhatStyle' AND Templates.ID = WhatTemplate ORDER BY Apply.AttributeID

Thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > A little Newbie help


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