Advertisement

05.30.2008 at 11:29AM PDT, ID: 23445565
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Trim function in SQL

Asked by kdeutsch in SQL Query Syntax

Tags: ,

My first query returns a SSN and a name to a drop down list box such as.
888997788--Malarkey John Lee
My next query needs to just take the SSN portion of this and query the database to find information about this individual.  Orifinall I did it my name but names can be the same SSN's are never the same for same name.  So how can I break apart the first query for the second query to look at.  When the first query is returned you then pick on that individual to return more information so they need to be able to see individual name.  following are SQL Syntax's

Thi spopulates DDL with list of names and SSN.
sql = "select sidstrSSN_SM + '--' + sidstrNAME_IND from CMS.dbo.tblSIDPERS where sidstrSSN_SM in (Select u.strSSN from tblAssignedPersonnel as u " _
                & "where u.bitPresent = 1 and intDrillStatus = 2 and u.intUICID in (select intUICID from tblUIC where intTaskForceID = " & taskforceID & " and strUIC =  '" & uic & "'))"

When they pick a name this sql query takes over and pulls more info, but I just need the SSN portion of the above query, how can I take off the name in the next query. because right now it looks a thte whole thing and returns a zero row to my labels.

 sql = "select  s.sidstrSSN_SM, s.sidstrGR_ABBR_CODE + '/' + s.sidstrPAY_GR as Rank, case when s.sidstrTECH_SVC_CODE in ('M', 'R', 'S', 'T', 'U', 'Z') then " _
                & "case when s.sidstrACT_STAT_PROG in ('5', 'A', 'E', 'F', 'N', 'R', 'S', 'T') then 'AGR' else 'TECH' end else 'M-day' end, " _
                & "s.sidstrST_ADDR + ',' + s.sidstrADDR_CITY + ',' + s.sidstrSTATES_US + ',' + s.sidstrZIP_CODE as address, " _
                & "(select count(*) from saddotnet.dbo.tblAssignedPersonnel h where p.strSSN = h.strSSN and h.dtattendance <= p.dtattendance) as count_attendance_as_at_dtattendance, " _
                & "p.dtattendance from cms.dbo.tblSIDPERS as s INNER JOIN saddotnet.dbo.tblAssignedPersonnel as p on p.strSSN = s.sidstrSSN_SM where " _
                & "sidstrSSN_SM like '" & SSN & "'"


Start Free Trial
 
 
[+][-]05.30.2008 at 11:38AM PDT, ID: 21680324

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 11:45AM PDT, ID: 21680379

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 11:57AM PDT, ID: 21680462

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 12:00PM PDT, ID: 21680494

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 12:07PM PDT, ID: 21680553

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 12:29PM PDT, ID: 21680725

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SQL Query Syntax
Tags: SQL, IE
Sign Up Now!
Solution Provided By: brad2575
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.30.2008 at 12:35PM PDT, ID: 21680760

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 12:41PM PDT, ID: 21680810

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 12:49PM PDT, ID: 21680875

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 12:52PM PDT, ID: 21680904

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628