Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
amitbadgi
Starting Member
29 Posts |
Posted - 2005-07-06 : 14:53:12
|
| Thanks for your reply, I shall explain in detail what exactly I am looking for, now I have 4 different cities, each with 2 tables(access), liek thisCityATable1 BID MailAddress Telephonenumber Table 2 BID Licensenumber TransactionamtCityBTable1 BID MailAddress Telephonenumber Table 2BID Licensenumber AccountnumberThe other 2 cities are similar as above, now I created a form in MSAccess and if I enter a BID the concerned data should show up, like if i enter a BID which belongs to city A then the mail adress, telphoen number and transaction amount should show up and if I enter a BID which belongs to cityB, then the related info should show up, now I have written a query for cityA and is working just fine, but I am not sure on how to combine all the 4 cities in one query, I cannot put everything in one table as some of the fields are different, and when a user enters a BID, he doesnt know to which city that BID belongs to. Some of em have told me to use 5 different forms and soem have told to use union, I am not relly sure as to how to use it, if you could help me out I would be greateful, thanks. |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2005-07-06 : 15:59:07
|
| You can use pass through parameters and select a city using an if statement to return the correct SelectIf @selectcity = A BeginSelect cola,colbFrom YourtableA EndIf @selectcity = bBeginSelect cola,colbFrom YourtableB EndIf @selectcity = C BeginSelect cola,colb,colZFrom YourtableC EndIf @selectcity = D BeginSelect cola,colbFrom YourtabledendJimUsers <> Logic |
 |
|
|
|
|
|
|
|