473,796 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert nickname to fullname when querying data

52 New Member
I have a table of providers that has a license number and fullname field, among others. Deman helped me with being able to enter a nickname and having it change to the fullname if a nickname exists in a nickname table when I have new entries. I also have a table called TA where I enter requests, linking to the providers table with the license number. (The fullname field exists only in the providers table.) I'd like to be able to query the TA table for requests by entering the nickname (as it exists in the nickname table) rather than entering the fullname. Can anyone help? Thanks in advance.
May 23 '07
13 3337
CindySue
52 New Member
I'm terriby sorry, but I'm not getting any results from the query. I copied the query info and pasted it into SQL view. I copied the Licensed Providers and Nicknames tables and named them LP and NN so the names would be the same. In LP I deleted all but 6 records. In TA I deleted all but 10 entries, using each license number from the LP table once and one four times. I used Dept. of Education as the Admin Agency in the LP table, and it exists exactly the same (I copied and pasted to be sure) in the NN table, with doe as the nickname. When I query I can't get any results at all, either from a nickname or from a partial name.
May 30 '07 #11
NeoPa
32,579 Recognized Expert Moderator MVP
The table names I used were the ones you provided. The query simply uses aliases, that's all. The SQL code was designed to copy and paste straight into a QueryDef's SQL view.
What do you mean you copied the tables?
What do you have in the way of tables now?
May 30 '07 #12
CindySue
52 New Member
I didn't understand about the aliases, so since I didn't have tables with those names I copied the Licensed Providers table and named it LP and copied the Nicknames table and called it NN. I also complicated things when I didn't make sure the date completed field was null in my practice data. I put their names back and made sure the date completed field is empty, and it seems to be working now. I REALLY appreciate all your patience and effort. Thank you so very much.
May 30 '07 #13
NeoPa
32,579 Recognized Expert Moderator MVP
Not a problem :) I'm glad it worked when you 'reverted'.
Wherever you see the keyword AS in SQL it indicates that the preceeding expression is to be named as the succeeding name.
Tables can get this treatment, but so can fields and more complicated expressions (including sub-queries, but let's not go there for now :D). It can also be written by simply forgetting the AS keyword, but It's my practice never to do that, as it's more confusing to read and understand.
May 30 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

11
3818
by: jguilford | last post by:
I have created a SQL Stored Procedure that uses a Case statement to determine the Order By. For one of the Case statements I am trying to turn a Char field into Datetime in for the Order By, however I can not get it to work. Can someone please take a look and my code below and tell me what I am doing wrong. Thank you. ORDER BY CASE WHEN @SortBy = 'dttm_stamp' THEN dttm_stamp End, CASE WHEN @SortBy = 'Event_Date1' THEN...
0
1814
by: aj | last post by:
DB2 WSE LUW 8.1 Fixpak 5 Red Hat AS 2.1 I'm trying to set up a federated view from one DB2 database to another in the same instance on the same server. I do a: create server <SERVER> type DB2/UDB version 8.1 wrapper DRDA authorization <INSTANCE_OWNER> password "<PASSWD>" options (NODE 'LOCAL',DBNAME '<DBNAME>',FOLD_ID 'N',FOLD_PW 'N')
9
2071
by: Kurt | last post by:
Hi I was trying to get this VB type code to work in C Sub SetColumns_Example( Dim ol As Outlook.Applicatio Dim MyFolder As MAPIFolde Dim itms As Item Dim itm As Objec Dim dtmStart As Date, dtmEnd As Dat Dim lngElapsed As Lon Set ol = New Outlook.Applicatio
5
15801
by: Jiggaz | last post by:
Hi, Look my stored procedure : __________________ ALTER PROCEDURE dbo.CreateAccount @Nickname varchar(30), @Password varchar(15), @Email varchar(50), @Date datetime,
1
2308
by: Mark Hollander | last post by:
Hi All, Could you please help me convert this code so that it will run in VB.NET Thank You Mark Hollander Private Type USER_INFO Name As String
3
7669
by: Jean-Marc Blaise | last post by:
Hi, Is there any reason why a CREATE NICKNAME statement fails if the remote object is an ALIAS ? I actually have an ALIAS that is used to point to the correct table in the remote DB, and would like the nickname to point to this alias, avoiding the obligation to drop and recreate the nickname any time. Thanks for your help,
7
3246
by: Arun Srinivasan | last post by:
I have a problem, I am getting SQL1042N The SQL statement is not supported. error when I try to create a MQT against a nickname. The source db is db2 version 9.1 fixpack 4, same as the target db and so the SQL is definitely supported and both are in windows 2003 server. Is there a way I could find why this error pops up. My syntax is like create mqt1 as (select col1, col2, ..............., colN from nickname where <predicate>) data...
4
3212
by: Arun Srinivasan | last post by:
I need to create an MQT on a nickname, the requirement is that I need to transfer data from source to target when required (this is because the nickname is slow - i can't implement required indices on the source table - tooo large). So when I tried create table table1 as (select * from nickname) data initially deferred refresh deferred; it returned sql0142N error - sql statement not supported. Both source and target dbs are db2 version...
9
35855
by: myotheraccount | last post by:
Hello, Is there a way to convert a DataRow to a StringArray, without looping through all of the items of the DataRow? Basically, I'm trying to get the results of a query and put them into a listbox. Right now it is done like this:
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.