<Unsupported Data Type>
<Unsupported Data Type>
<Unsupported Data Type>
<Unsupported Data Type>
<Unsupported Data Type>
<Unsupported Data Type> <Unsupported Data Type> <Unsupported Data Type> <Unsupported Data Type> <Unsupported Data Type> <Unsupported Data Type> <Unsupported Data Type> <Unsupported Data Type>
<Unsupported Data Type> <Unsupported Data Type>
<Unsupported Data Type>
Go Back  Xtreme Visual Basic Talk > > > <Unsupported Data Type>


Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2008, 09:52 AM
holtzy holtzy is offline
Senior Contributor
 
Join Date: Jul 2002
Location: USA
Posts: 1,054
Talking <Unsupported Data Type>


I'm using the following sql and I can't figure out why it's giving me "<Unsupported Data Type>" for the first two fields. The RowNum field is the only one giving me actual information. Any idea why?

SELECT fldNo, fldID, RowNum
FROM (SELECT fldNo, fldID,
(SELECT COUNT(*) AS Expr1
FROM tbl AS t2
WHERE (fldID = t1.fldID)) AS RowNum
FROM tbl AS t1) AS t3
__________________
God is good!!!
Reply With Quote
  #2  
Old 07-08-2008, 09:39 AM
lebb's Avatar
lebb&lt;Unsupported Data Type&gt; lebb is offline
Disillusioned Code Poet

Retired Moderator
* Guru *
 
Join Date: Apr 2002
Location: Tennessee, USA
Posts: 12,808
Default

What type of database are you using? How are fldNo and fldID defined? And where are you running this query?

I'm having a bit of trouble following the logic of your query. Is your intended result different from this:
Code:
SELECT tbl.fldNo, tbl.fldID, RowNum
FROM (
    SELECT fldID, COUNT(*) AS RowNum
    FROM tbl AS t2
    GROUP BY fldID
  ) counts
  INNER JOIN tbl ON tbl.fldID = counts.fldID
? I don't know the relationships and constraints on your table, so I can only speculate, but it seems more complex than it needs to be.
__________________
Laura

Ita erat quando hic adveni.
Reply With Quote
  #3  
Old 07-08-2008, 09:43 AM
holtzy holtzy is offline
Senior Contributor
 
Join Date: Jul 2002
Location: USA
Posts: 1,054
Default

It's sql server, fldNo is varchar & fldID is int. I'm running it in VS2005 query designer.

I'm trying to get the top row for each fldID. I wouldn't doubt that I've over-complicated it
__________________
God is good!!!
Reply With Quote
  #4  
Old 07-08-2008, 09:46 AM
holtzy holtzy is offline
Senior Contributor
 
Join Date: Jul 2002
Location: USA
Posts: 1,054
Default

I tried your revision, and the first field is still giving me "<Unsupported Data Type>". Do I need to do a conversion of some kind? I wouldn't see why, but who knows.
__________________
God is good!!!
Reply With Quote
  #5  
Old 07-08-2008, 09:50 AM
lebb's Avatar
lebb&lt;Unsupported Data Type&gt; lebb is offline
Disillusioned Code Poet

Retired Moderator
* Guru *
 
Join Date: Apr 2002
Location: Tennessee, USA
Posts: 12,808
Default

So how does that compare to my query? Does it have the same error when you run it?

If you'd care to explain in a bit more detail how your table is structured and what results you expect, I may be able to help you fine-tune it. But even given an overly complex query, I'm not sure why you're getting that error. Can you try running the same query from SQL Server Management Studio or Query Analyzer to see if the problem is related to the query itself or the tool calling it?

Edit: Whoops, sorry, posted before seeing your reply
__________________
Laura

Ita erat quando hic adveni.
Reply With Quote
  #6  
Old 07-08-2008, 10:01 AM
holtzy holtzy is offline
Senior Contributor
 
Join Date: Jul 2002
Location: USA
Posts: 1,054
Default

It wasn't erroring per-se, it was giving the value of that field in each row of "<Unsupported Data Type>". I ran it in SQL Server Management Studio as you suggested and it works just fine. Weird.

Thanks!
__________________
God is good!!!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
&lt;Unsupported Data Type&gt;
&lt;Unsupported Data Type&gt;
&lt;Unsupported Data Type&gt; &lt;Unsupported Data Type&gt;
&lt;Unsupported Data Type&gt;
&lt;Unsupported Data Type&gt;
&lt;Unsupported Data Type&gt; &lt;Unsupported Data Type&gt; &lt;Unsupported Data Type&gt; &lt;Unsupported Data Type&gt; &lt;Unsupported Data Type&gt; &lt;Unsupported Data Type&gt; &lt;Unsupported Data Type&gt;
&lt;Unsupported Data Type&gt;
&lt;Unsupported Data Type&gt;
 
&lt;Unsupported Data Type&gt;
&lt;Unsupported Data Type&gt;
 
-->