Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Select and convert to string

Posted on 2013-11-12
2
357 Views
Last Modified: 2013-11-12
I am using a dreamweaver extension to export data to excel but it has a bug and gives an error upon a large number.
Workaround is to select the fields for the recordset and convert them into 'string' so that the error is avoided, they said I should add "number" (quotes) before and after the number.

How can I do this ?  this is my select statement:

--

SELECT a.UserId, a.UserType, a.FirmId, a.EmployerId, a.LastNm, a.FirstNm, a.DobD, a.SSN, a.Email, a.Nationality, a.NiStatus, a.ExpiresOnD, a.Docstatusstat, a.NIVMaxStatus, a.I94DateD, a.I94, a.I797Date, a.I797, a.EadDate, a.Ead, a.ApDate, a.ApNum, a.Iap66Date, a.Iap66, a.GcDate, a.GC, a.I20Date, a.I20, a.PpExpireOnD, a.PpNum, a.PobCountry, b.MaidenNm as Employer, d.MailStr + ' ' + d.MaidenNm as Attorney, a.PobCountry, a.archivedcont, a.contactstatus, a.Docstatusstat, e.Docstatdesc,a.Dswg, a.VisaExp, a.VisaType, a.VisaStatus
FROM users a Left join users as b on a.employerid = b.userid Inner join attscont as c on a.userid = c.userid Inner join users as d on c.attyid = d.userid left join Documentstatus as e on e.documentstatus = a.Docstatusstat
WHERE a.usertype = 'contact' and a.firmid = MMColParam AND d.userid = MMColParam2 AND a.Archivedcont LIKE 'MMColParam3' and a.Contactstatus LIKE 'MMColParam4' AND ISNULL (a.FirstNm,'') LIKE 'MMColParam5%' and ISNULL (a.LastNm,'') LIKE 'MMColParam6%' and ISNULL (a.SSN,'') LIKE 'MMColParam7%' and ISNULL (a.email,'') LIKE 'MMColParam8%' and ISNULL (a.Nationality,'') LIKE 'MMColParam9%' AND ISNULL (a.Nistatus,'') LIKE 'MMColParam10%'
ORDER BY MMColParam500

--
0
Comment
Question by:amucinobluedot
2 Comments
 
LVL 5

Accepted Solution

by:
dannygonzalez09 earned 500 total points
ID: 39642056
you can do this to convert a numeric or integer column to string

SELECT '"' + CONVERT(VARCHAR(10),IntegerColumnName) + '"'

what i'm doing here is inserting " (double quotes with in single quotes) and concatenating it with integer column convert to a string

change the integerColumnname with your numeric or integer column and you can also change the length to what ever you want ex: VARCHAR(10) to VARCHAR(50)
0
 

Author Closing Comment

by:amucinobluedot
ID: 39642102
:)
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question