473,587 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

group by Ntext

1 New Member
hey guys, I'm a complete noob when it comes to SQL, thanks for any help you can give.

the folowing query wants me to group by fields that are Ntext and this can't happen. any suggestions?

SELECT Distinct 'ticketStatus.a spx?ticketNum=' + CONVERT(varChar ,dbo.sv_inquiry .inquiry_id) AS URL ,dbo.sv_inquiry .transfer_rep,d bo.sv_inquiry.i nquiry_id AS [Ticket #],
dbo.sv_inquiry. logged_dt AS [Logged Date],sv_inquiry.clo sed_dt,ltrim(rt rim(dbo.account _contact.first_ name)) +' ' + ltrim(rtrim(dbo .account_contac t.last_name)) AS Customer,dbo.sv _inquiry.priori ty,dbo.sv_inqui ry.status+' - '+dbo.sv_inquir y.state AS status,
dbo.sv_inquiry. it_short_desc AS [Short Desc], dbo.account.nam e as Property, dbo.sv_inquiry. type as type, dbo.sv_inquiry. it_source as Src, dbo.sv_inquiry. it_service as Service, DATEDIFF(n,sv_i nquiry.logged_d t,sv_inquiry.cl osed_dt) as Elapsed,
CAST(dbo.sv_inq _txt.inquiry_tx t AS nvarchar(100)) AS Details, CAST(dbo.sv_sol ve_txt.solution _txt AS nvarchar(100)) AS Solution
FROM (SELECT dbo.sv_inquiry. inquiry_id as ID, dbo.sv_inquiry. logged_dt as logged_dt , MIN(dbo.sv_inqu iry_audit.actio n_dt) AS action
FROM dbo.sv_inquiry WITH (NOLOCK) INNER JOIN
dbo.sv_inquiry_ audit WITH (NOLOCK) ON dbo.sv_inquiry. inquiry_id = dbo.sv_inquiry_ audit.inquiry_i d INNER JOIN
dbo.account WITH (NOLOCK) ON dbo.sv_inquiry. account_id = dbo.account.acc ount_id left Outer JOIN
dbo.grp WITH (NOLOCK) ON dbo.sv_inquiry. transfer_grp = dbo.grp.name
WHERE dbo.sv_inquiry. state ='Closed' and ia_action = 'Status Change' and new_value = 'Resolved' Group by logged_dt, dbo.sv_inquiry. inquiry_id) DERIVEDTBL inner Join dbo.sv_inquiry on dbo.sv_inquiry. inquiry_id = ID INNER JOIN
dbo.account WITH (NOLOCK) ON dbo.sv_inquiry. account_id = dbo.account.acc ount_id INNER JOIN
dbo.account_con tact WITH (NOLOCK) ON dbo.sv_inquiry. account_contact _id = dbo.account_con tact.account_co ntact_id INNER JOIN
dbo.sv_inquiry_ audit WITH (NOLOCK) ON dbo.sv_inquiry. inquiry_id = dbo.sv_inquiry_ audit.inquiry_i d INNER JOIN
dbo.sv_inq_txt WITH (NOLOCK) ON dbo.sv_inquiry. inquiry_id = dbo.sv_inq_txt. inquiry_id INNER JOIN
dbo.sv_solve_tx t WITH (NOLOCK) ON dbo.sv_inquiry. inquiry_id = dbo.sv_solve_tx t.inquiry_id INNER JOIN
dbo.grp WITH (NOLOCK) ON dbo.sv_inquiry. transfer_grp = dbo.grp.name

group by dbo.sv_inquiry. logged_dt, dbo.sv_inquiry. inquiry_id, dbo.sv_inquiry. transfer_rep, dbo.sv_inquiry. closed_dt, dbo.account_con tact.first_name , dbo.account_con tact.last_name, dbo.sv_inquiry. priority, dbo.sv_inquiry. status, dbo.sv_inquiry. state,dbo.sv_in quiry.it_short_ desc, dbo.account.nam e, dbo.sv_inquiry. type, dbo.sv_inquiry. it_source, dbo.sv_inquiry. it_service, dbo.sv_inquiry. inquiry_id
Feb 12 '08 #1
1 3018
code green
1,726 Recognized Expert Top Contributor
At least take some time to use Code tags when posting code.
Apart from that
What are you tring to do?
What is happening?
the folowing query wants me to group by fields that are Ntext and this can't happen. any suggestions


This is meaningless
Feb 13 '08 #2

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

Similar topics

2
13051
by: AJ | last post by:
Hi , I have this query paprojnumber is varchar patx500 is text palineitemseq is int select Paprojnumber,Patx500,max(palineitemseq) from pa02101,pa01601 where
7
1757
by: laurenq uantrell | last post by:
I know I should know this but here goes... I have a table with the following rows: UniqueID int IDENTITY ParentUniqueID int RecordLabel nvarchar(50) RecordText ntext RecordDate DateTime What I'm trying to do is to group all records by ParentUniqueID
3
8895
by: Matik | last post by:
Hello to all, Below the sample code: declare @arg_szMsgText ntext set @arg_szMsgText = isnull(@arg_szMsgText, N'unknown message') Now the error message I get: "The assignment operator operation cannot take a ntext data type as an
2
8748
by: Sileesh | last post by:
HI I know this is not the right forum to post this question, but i think some one might have a suggestion. I have a Table "Test" with columns Id bigint (PK), Number Varchar(50), Notes ntext. in sql server 2000 I ahve a stored procedure in which i am trying to insert the same data as new record with column "Number" changed.
1
2843
by: A_PK | last post by:
I got one field, NOTE, its type is Ntext field. I have problem when query the statement using GROUP BY, could some pls kindly guide me. please found the sql query below... SELECT tblParent.indexno, tblParent.custno, tblParent.compname, tblParent.tt, tblParent.ordnotes FROM tblParent INNER JOIN tblChild ON tblParent.tid = tblChild.tid
4
8761
by: Igor | last post by:
I have one SELECT statement that needs to return one ntext field from one table and count something from other table, problem is that all fileds that are not in count have to be in group by and ntext can't be in group by... i hope you understend what i want to say here :), so is there any solution to this problem or what is the best workaraund you would use? example: TABLE projects project_id int
2
2747
by: Igor | last post by:
Is there a way to transfer ntext data from one table to another? I tried this UPDATE SET = (SELECT FROM WHERE =1) WHERE = 1;
3
2931
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I try to follow Steve's paper to build a database, and store a small text file into SQL Server database and retrieve it later. Only difference between my table and Steve's table is that I use NTEXT datatype for the file instead of using IMAGE datatype. I can not use SqlDataReader to read the data. I need your help, Thanks. -David (1) I have a table TestFile for testing: ID int FileName navrchar(255)
2
4407
by: verb13 | last post by:
I am running this query to an sql server 2000 database from my asp code: "select * from MyTable where MySqlServerRemoveStressFunction(MyNtextColumn) = '" & MyAdoRemoveStressFunction(MyString) & "'" The problem is that the replace function doesn't work with the ntext datatype (so as to replace the stresses with an empty string). I had to implement the MySqlServerRemoveStressFunction, i.e. a function that takes a column name as a...
0
8349
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...
0
8221
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
6629
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...
1
5722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3845
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
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
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
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
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.