473,493 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Grouping 1st 2 characters (2nd try)

Hello,
I want to create a Dataview which contains, grouped, the first 2 characters
of a cell-value.
I tried (SQL-Server background):

dv = New DataView(ds.Tables("Product"), _
"distinct left(artcode, 2) group by artcode", _
"artcode", _
DataViewRowState.CurrentRows)

Can someone explain me how to achieve this?
Thanks!
Nov 20 '05 #1
4 1020
Cor
Hi Sjaakie,

I think this is one of the wishes from a lot of people what you try to do.
I have untill now not seen a solution for this.

When you see the friendly discussion between me and Peter below you can see
in the given samples, that the dataview is in the rowfilter nothing more
than the datatable.select and visa versa.
It can only say A=B (or more complex comparising)
The sort can only say (a, b Asc)
or (a ASC, b Desc)
etc.

With the rowfilter you can filter (select)
With the sort you can sort
But as often told in dotnet groups it is not a SQL statement.

Untill now I have seen in the dotnet newsgroup only 2 solutions for it, that
are:
to use the SQL select distinct for this and create a seperate datatable
or
to create a seperate array by looping though the table.

I hope this helps anyway?

Cor

Nov 20 '05 #2
Sjaakie,
In addition to Cor's comments:

The only place I know of where the syntax that expressions (such as
RowFilter) in the DataSet OM is documented is the DataColumn.Expression help
topic:

http://msdn.microsoft.com/library/de...ssionTopic.asp
David Sceppa's book "Microsoft ADO.NET - Core Reference" from MS Press
covers using a DataView and every thing else ADO.NET.

David's book is both a good tutorial on ADO.NET plus a good desk reference
once you know ADO.NET!

Hope this helps
Jay

"Sjaakie Helderhorst" <di*********@hotNOTmail.com> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
Hello,
I want to create a Dataview which contains, grouped, the first 2 characters of a cell-value.
I tried (SQL-Server background):

dv = New DataView(ds.Tables("Product"), _
"distinct left(artcode, 2) group by artcode", _
"artcode", _
DataViewRowState.CurrentRows)

Can someone explain me how to achieve this?
Thanks!

Nov 20 '05 #3
Hello,

Thanks for your response.
Since I'm not the only mortal requesting this feature it might be a good
idea to put this on a wishlist.
Is there any?

"Cor" <no*@non.com> schreef in bericht
news:OR**************@TK2MSFTNGP11.phx.gbl...
Hi Sjaakie,

I think this is one of the wishes from a lot of people what you try to do.
I have untill now not seen a solution for this.

When you see the friendly discussion between me and Peter below you can see in the given samples, that the dataview is in the rowfilter nothing more
than the datatable.select and visa versa.
It can only say A=B (or more complex comparising)
The sort can only say (a, b Asc)
or (a ASC, b Desc)
etc.

With the rowfilter you can filter (select)
With the sort you can sort
But as often told in dotnet groups it is not a SQL statement.

Untill now I have seen in the dotnet newsgroup only 2 solutions for it, that are:
to use the SQL select distinct for this and create a seperate datatable
or
to create a seperate array by looping though the table.

I hope this helps anyway?

Cor

Nov 20 '05 #4
Thanks!

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> schreef in bericht
news:en**************@TK2MSFTNGP09.phx.gbl...
Sjaakie,
In addition to Cor's comments:

The only place I know of where the syntax that expressions (such as
RowFilter) in the DataSet OM is documented is the DataColumn.Expression help topic:

http://msdn.microsoft.com/library/de...ssionTopic.asp

David Sceppa's book "Microsoft ADO.NET - Core Reference" from MS Press
covers using a DataView and every thing else ADO.NET.

David's book is both a good tutorial on ADO.NET plus a good desk reference
once you know ADO.NET!

Hope this helps
Jay

"Sjaakie Helderhorst" <di*********@hotNOTmail.com> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
Hello,
I want to create a Dataview which contains, grouped, the first 2

characters
of a cell-value.
I tried (SQL-Server background):

dv = New DataView(ds.Tables("Product"), _
"distinct left(artcode, 2) group by artcode", _
"artcode", _
DataViewRowState.CurrentRows)

Can someone explain me how to achieve this?
Thanks!


Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1855
by: Debbie Davis | last post by:
Hi there, SQL 2000 I have the following query: SELECT sponsor, COUNT(sponsor) * 2 AS total FROM Referrals GROUP BY sponsor Works great, returns the sponsor and the total * 2 of their...
2
1684
by: Andreas Håkansson | last post by:
Seeing how my previous post seem to have fallen between the cracks, I thought I would have a second, more direct, go at it. So my question is "Is it possible to group (Muenchian method) over...
3
2711
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
12
2644
by: Laser Lu | last post by:
Hello, everybody, do you know how to use this Grouping Construct? (?> ) I've found its reference on MSDN, but still can not understand it totally. The following is its description: ...
1
1426
by: Regnab | last post by:
I often want to query the database with certain parameters in my query which I do not want included in the query result. The problem is when I want to group on 1, sum the 2nd (and group by) and...
7
2668
by: maffonso | last post by:
Hi guys, My table has a memo field. At the end of the month a run a report and I would like to concatenate the memo fields in a unique field by dept. Im thinking doing this through totals button...
6
1223
by: bullockbefriending bard | last post by:
(I apologise in advance for posting something slightly OT, but plead in mitigation that I'm trying to re-write an old, suboptimal VB6 (erk) brute-force attack in a shiny, elegant, pythonic manner....
4
3841
by: Chris | last post by:
I tried to retrieve the digit grouping symbol in MSAccess but unfortunately 3;0 is retrieved instead of comma which is my symbol. Function retrieves decimal symbol and list separator without any...
0
1521
by: Roman Bertle | last post by:
Hello, I try to format monetary values using the locale module, python2.5: Python 2.5.2a0 (r251:54863, Jan 3 2008, 17:59:56) on linux2 Type "help", "copyright", "credits" or "license" for...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7195
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...
1
6873
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...
0
7367
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...
0
5453
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,...
0
4579
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.