Sorting Based On Various Data Types

Jul 23, 2005

I've been tasked with designing a database to store collective
agreements. I need to store each sub-article of each article of each
agreement in it's own row within a table. I'm having difficulty
figuring out the best way to store each sub-article's identifier so
they sort properly.

The majority of the collective agreements use numbers in a dotted
notation, for example:

1.1
1.2
1.3.1
1.3.2
1.3.3
1.4

Some agreements mix letters with numbers, such as:

A-1.1
1.1.A.1

Any ideas how I should deal with this?

View 4 Replies


ADVERTISEMENT

One Or More Columns Do Not Have Supported Data Types, Or Their Data Types Do Not Match.

Oct 20, 2007



Hi,

I´m exporting an ms-excel file, then I use a lookup transformation to get a field from a SQL Server 2005 table. The Lookup transformation editor, after selecting the table, shows a warning that says:

at least one mapping between a column from available input columns ans a column from available lookup columns must be defined on the columns page.

So I try to make a relationship in the Lookup transformation editor's column tab where I find the Available input columns and the available lookup columns but I get the following error:

The following columns cannot be mapped:
[Department, DEP_CLEGALCODE]
One or more columns do not have supported data types, or their data types do not match.

The field in SLQ Server is varchar(10) and the input field is a derived column transformation; I have tried different Data Types but I always have the same error.

The DataFlow is: ExcelSource --> Derived Column --> Lookup --> Flat file destination

thanks.

View 6 Replies View Related

Sorting Based On Foreign Key Feilds

Dec 1, 2006

shibu writes "I have a table 'manage_user_types' and its primary key is 'Category_ID'. There is another field 'Category_Parent_ID' which refers the 'Category_ID' in the same table. And one more field is 'Category_Name' which is related to 'Category_ID'. ie.when displaying the table in front end, 'Category_Name' is displayed under 'Category_Parent_ID'. I want to sort the table with 'Category_Name' when clicking the 'Category_Parent_ID' to sort. What should i do?"

View 1 Replies View Related

XML Path Sorting Based On Input Flow

Feb 25, 2014

I need to sort based on the values sent from the input xml column resultdata

This is an value which i have in my database, sent from front end.

Currently the display is based on database storage level of master data. i will not be able to change the master data ordering. based on selection, i have to sort since i have an logic which stored the data into resultdata column

CREATE TABLE [dbo].[Table_Prod](
[ProdCode] [nchar](5) NULL,
[ProductName] [nchar](50) NULL
) ON [PRIMARY]
GO
INSERT [dbo].[Table_Prod] ([ProdCode], [ProductName]) VALUES (N'RD ', N'Bus ')

[Code] ....

Current Result
IdSalesMonthSeasonDeptDataProductInfoProdDataProductInfoDescription
1Jan Winter RO,HOHeadOffice,RegionalOfficeRD,AI,SA Bus,Ship,PlaneSales for the month of Jan
2May Summer SO,HOHeadOffice,SalesOfficeAI,RD,TR,SA Bus,Ship,Train,PlaneMay sales information
3Sep Rain HO,RO,SOHeadOffice,SalesOffice,RegionalOfficeSA,TR,RD Bus,Ship,TrainSales for the month of Sep in the rain season

Expected Result
IdSalesMonthSeasonDeptDataProductInfoProdDataProductInfoDescription
1Jan Winter RO,HORegionalOffice, HeadOfficeRD,AI,SA Bus,Plane,ShipSales for the month of Jan
2May Summer SO,HOSalesOffice, HeadOfficeAI,RD,TR,SA Plane,Bus,Train,ShipMay sales information
3Sep Rain HO,RO,SOHeadOffice,RegionalOffice,SalesOfficeSA,TR,RD Ship,Train,BusSales for the month of Sep in the rain season

View 1 Replies View Related

Sorting Text File Based On Any Column

Aug 24, 2007

Hi All,
Is there any command which will sort data in text file based on 3rd column (based on any column)?
Thanks
Sanjeev

View 1 Replies View Related

Return Value Based On Record With Multiple Types

Jan 15, 2015

I want to return Order records which are one type and don't have the other type.

The issue is I have Orders with which has 2 distriubtion types .

Example
Order 12345 has Type S and Type X.
Order 67891 has Type S

I only want to return Order 67891 that are s Type and does not have type X

View 1 Replies View Related

Sorting Parameter Values In SSRS Model Based Report

Sep 21, 2007

Hi,

I have created a report using Report designer (Visual Studio, using Data Model as a data source), in the report I had created few datasets (with single filed) to populate the report parameters, lets say I have created a multi valued Parameter CustomerName and assigned field from a dataset,

result are coming correctly and combo box is getting populated but the customers are not in alphabetical order!

I want to sort it and need to specify it in report (please note that I am using Report Model as a data source and I can€™t sort the source table in the data base to get the result sorted)


Please let me know if anybody has done that or forward me if know some link which talks about it.


Thanks in advance.

Regards,

Jayant Jape

View 23 Replies View Related

Matrix Report:Adding Average Column/Sorting Based On Last Month/Conditional Formating

Aug 2, 2007



I have a matrix report with 2 column SaleAmount and ProfitAmounts by Month like


Sale Profit
Dealer 5/1/2007 6/1/2007 7/1/2007 5/1/2007 6/1/2007 7/1/2007
A 100 200 300 20 25 15
B 200 250 50 30 45 19


how can i do following 3 things


1)Add Total column for Sale and Average column for Profit
2)Sort report by lastMonth of Sale (here 7/1/2007) High to low
3)if last month of sale(here 7/1/2007) is less than second last month here (6/1/2007) whole row should be red

thanks

View 1 Replies View Related

Sorting And Grouping Question By Allowing Users To Select The Sorting Field

Feb 11, 2007

I have a report where I am giving the users a parameter so that they can select which field they would like to sort on.The report is also grouping by that field. I have a gruping section, where i have added code to group on the field I want based on this parameter, however I also would like to changing the sorting order but I checked around and I did not find any info.

So here is my example. I am showing sales order info.The user can sort and group by SalesPerson or Customer. Right now, I have code on my dataset to sort by SalesPerson Code and Order No.So far the grouping workds, however the sorting does not.



Any suggestions would help.


Thanks

View 1 Replies View Related

Reporting Services :: Horizontal Axis Show Last Value In First And Last Space When Sorting A-z But Shows Correctly When Sorting Z-a

Jul 10, 2015

SSRS 2012 - VS2010...The report compares two years with a sort order on a value that has been engineered based on text switched to int.  When sorting A-Z this is the result in the horizontal axis is: 5th, K, 1st, 2nd, 3rd, 4th, 5th..When sorting Z-A the result in the horizontal axis is:5th, 4th, 3rd, 2nd, 1st, PreK..Z-A is correct but A-Z sorting shows 5th as the start and end.  The magnitude of the PreK location is correct but the label is wrong on the A-Z sort order.  The sorting is implemented using the Category Group sorting option.

View 6 Replies View Related

Reporting Services :: Table Data Types For Data Driven Subscriptions

Jun 11, 2015

I am trying to find a reference for a client that lists the fields available to be substituted into a data driven subscription from the query, along with the expected data types.  For example, the field on whether or not to include a link to the report seems to be expecting a bit data type.I have searched and can't seem to find anything.  I guess I could walk through the interface and try different data types, but if  a list exists, that would be better. 

View 4 Replies View Related

Mapping Of SQL Server Data Types To Integration Services Data Type

Oct 14, 2005

Does anyone know of any cross-references between SQL Server data types and the new data types introduced with SQL Server Integration Services? 

View 6 Replies View Related

Reporting Services :: SSRS Export To Excel Showing Data Type As General For All Data Types

Sep 16, 2015

One of my report has different data types like decimal,percentage and integer values.

When I exported the report to excel , all the values are showing as "general" data type.

How to get excel data type same as ssrs report data type by default when exported to excel?

View 2 Replies View Related

Data Access :: Validation For Length Of The Character Data Types

Jun 10, 2015

I Have a table with #Sample like below

=================================
#Sample
id int,
SSN varchar(20),
State varchar(2)
 
Sample Data:

ID SSN STATE
1 999-000-000 AB
2 979-000-000 BC
3 995-000-000 CD
=================================

We used filter logic based on the SSN & State.

We are passing these values through variables like

Declare @State varchar(2)
Declare @SSN varchar(20)

While run time these values are lets suppose @SSN = '999-000-000' & @State='ABC'

Now the Result is displayed with the state data Like 'AB' only.

Output: 1 999-000-000 AB

instead it should give system generated error.

Here I have 2 Questions:
1. Why it is taking 1st 2 Charecters?
2. Why it does not have any system generated for length?

I can do validation with Length function for these 2 variables however if have 100 variables then it should not feasible case. So, what is the reason behind? 

View 5 Replies View Related

T-SQL (SS2K8) :: Load Data From Flat File Source Into OleDB Destination By Changing Data Types In SSIS

Apr 16, 2014

I have an source file and i have to load it into the data base by changing datatype of the columns in ssis

View 1 Replies View Related

Modifying Data Column Names And Data Types

Mar 13, 2008

I'm in the process of converting a rather huge VSAM database into a set of SQL tables.
I am using the same data names from the mainframe (like XDB-NAME to RDB-NAME).
I load the files using Import Export Data and it makes the tables with such column names as col001, col002, col003, etc... and always sets the data types to varchr(255).
And I have to cut and paste the data names from the manframe side to the server side (and the data types to.) 
So, is there an easier way to do this? Or am I doomed to cut-n-paste my days away...
Thanks for any help.
 
 
 

View 2 Replies View Related

ODBC-based To OLE DB-based Data Transfer

Oct 7, 2006

I would like to transfer selected data from an ODBC-based table to a OLEDB-based table. However, there isn't a data flow source on the Data Flow Design screen to accomodate such an action. Please help!

View 1 Replies View Related

Sorting Data

Apr 17, 2008

Hi,

I have a column containing data

3 KB
16 KB
2 KB
4 KB
43 KB

How to sort this column and display results like:

43
16
4
3
2

Thanks.

View 7 Replies View Related

Sorting Some Data...

Jul 20, 2005

ok..here goes..I have a name field in my table called "bname"all of the data in this field has full names in it, spaces areseparated by a "+"ie. "john+doe"i have two other fields that are currently NULL. "First_name" and"Last_name"now my question is obvious.I need to populate "First_name" with all of the data in "bname" to theleft of the "+"and likewise to the Right of the "+" in "Last_name"i sort of know how i would do this in ASP... but im trying to makethis a DTS package... so i was wondering if this could be done in SQLThanks for any help! :DMario C.

View 4 Replies View Related

Sql Types - Simple SQL Server Queries/handling Variable Types

May 26, 2005

SQL Server 2000, ASP.Net 1.1

I've been writing this stuff for a while, and can't seem to come to the
conclusion of how I should be retrieving data and assigning this data
to variables.

Since i'm using SQL Server, I'm convinced that I should be using the
datareaders GetSqlDouble (or whatever) function, but this would mean i
need my local variables to be one of the SQL types.  The problem
with that is, that there will have to be lots of conversions done by me
to be able to use a SQL type in my application.

For instance, I have a class where i'm retrieving dates.  In order
to retrieve them correctly (Null values included), I need to retrieve
them with GetSqlDateTime(), then when it comes time to display the date
in a table, i must first check for nulls, then convert to a
string.  This seems to be very cumbersome.  Would I be better
off just using GetDateTime(), and the .ToString method, and ignoring
Sql Types all together?

so, basically, how are you guys using your sql server data?  with
the supplied sql types, and doing all of the post-processing work
manually?  I feel like i'm having trouble conveying my
issue...hopefully someone knows what i mean....i'd just like some
direction to save trouble in the long run, since i feel like there's
got to be a better way...

Confused!

Thanks,
JJ

View 1 Replies View Related

Sorting Data Upon Import Into SQL 7

Sep 12, 2001

Hello all,
The problem goes like this. I am trying to upsize all my data to a
SQL server and get it out of the old Access 97 database. One of our tables
involves testing reports which tell if an object has passed or failed and
its main key is it's ID autonum. When I look at the table in Access, I see
that the first record in the table has a date of 1/01/97 with an id of 1 and continues through today. When I bring those records into SQL 7, the first record contains a date of 9/01/99 and continues out of order down the table. I need the data in the SQL server to begin with the 1997 record like it is in Access and not with the 1999 record. I cannot have the records appearing in the table as 20, 3, 4, 5, 1, 2 but I need it as 1, 2, 3, 4, 5, 6, because
the id must be in sync correctly. How can I sort the data in SQL 7 ?

View 1 Replies View Related

Sorting Data, ADO, SQL Server Etc...

Feb 21, 2008

Ok, it is a given that sorting operations are sometimes expensive in SQL Server using the ORDER BY clause because the relational model is not really well suited to sort data blah blah blah.

So the canned DBA response is "this is a presentation issue, handle it in the presentation layer".

OK, great. Problem solved. So I am digging around in the ADO.Net object model trying to give a junior developer some guidance and i am trying to figure out what is the best way in ADO.Net to order what we used to call a recordset where the sorting is not done at the SQL Server, but in IIS.

I imagine there is some overhead in this operation as well. Is it really going to save me some overall performance or am I just shifting the burden and I will not likely see any appreciable difference?

View 8 Replies View Related

Sorting Out Data In A Field

Apr 19, 2004

Hi there,

I got one prob and i need help to solve it.
I got this one field in a table which contain a lot of datas and i need to sort it out into as many different data as a field for each.
Example:

ASP_Tin No
----------------

ss24fg
ss98jk
tp98ij
yh88ij
yh67tr
tp34ed
fg98bv
fg56sl
..........

and i need to sort it out into like this

ss tp yh fg
------------- ------------- ---------------- ---------------
ss24fg tp98ij yh88ij fg98bv
ss98jk tp34ed yh67tr fg56sl

i need to do it in sql statement which is in stored procedure
hope somebody can help me
Thanx

View 2 Replies View Related

Sorting Data Having Months

Sep 21, 2006

Dear all,



I have a field [Month] in my table AA.having Data like ( January,February,March,April etc.)

I need to sort them by starting of month

lets say as

January

February

March

How i can i do this

Have no index and can't define a index on this field

Thanks for ur time and Help



Regards

Mohd Sufian

View 12 Replies View Related

Copying Data From One Table To A New One With Some Different Data Types

Mar 30, 2007

Is it possible to easily copy data from one table to another if the data types don't match.   I know you can do a INSERT INTO table1(col1,col2)  SELECT (col2,col7) FROM table2 if the data types match but is there a way to do this if they don't. I'm not trying to copy date times into bit fields or anything.  I just have an old table that I built when I really didn't know what I was doing now I at leastthink I have a better understanding of what data types to use, so I was wanting to move the data in the orignal table to my new one.  Most of the fields in the olddatabase are text datatypes and the new database is nvarchar(50) data types.  Thanks for any suggestions. 

View 4 Replies View Related

Sorting The Data In Ascending Order .

Aug 16, 2002

Hi ,

Hopw can i sort the data in the ascending order so that i can see the date of my log files imported at the top of my table .

Right now my log files get imported and appended in the tables but they get appended in the descending order at the bottom of the last data .

Is there any way to sort the data so that i can see it in the reverse way when i open my tables ?

Many Thanks .

Anita.

View 1 Replies View Related

Sorting Three Different Data Through One Column With 2 Values Only.

Jan 21, 2008



can anyone please help on a sql statement that would sort out three kinds of data. let's say i have a column that contains a status flag. there are only 2 possible values, add and delete. now, i want to sort out three kinds of data: add_only, delete_only, and update. Update is the data that contains duplicate records in the table. Which means, there are two rows having same "student_number" but two different status flags. This happens when there's an update or change in data, such as new address or new phone number. The old row/data is sent with status flag of delete, while the updated data is sent with status flag of add. Example below. An output table with a new column of tag is created.












reports table

STUDENT_NO
NAME
ADDRESS
PHONE
STATUS FLAG


1
McKenzie
Ohio
9111111
add


2
Hario
New Jersey
1234567
add


3
Oda
Japan
9876543
delete


4
Davis
Chicago
1112222
add


5
Rodriguez
Detroit
4445555
add


1
McKenzie
Ohio
7778888
delete


4
Davis
Detroit
1112222
delete









create, remove, update table

STUDENT_NO
NAME
ADDRESS
PHONE
STATUS FLAG
TAG

2
Hario
New Jersey
1234567
add
create

5
Rodriguez
Detroit
4445555
add
create

3
Oda
Japan
9876543
delete
remove

1
McKenzie
Ohio
9111111
add
update

4
Davis
Chicago
1112222
add
update

Anyone knows what SQL statements to use to have this output? Thanks.


View 6 Replies View Related

SQL Data Types

Dec 29, 2004

Hello,

I have a really dumb question regarding SQL data types. I have a couple columns in a table that are specified as MONEY. These columns are being read from my web app and displayed on the website for reference when filling in other information.

My problem is that when it is displayed on the website it give four decimal places instead of two. For example I want it to report $33,000.29 but what is actually displayed is $33,000.2965.

How can I set up either SQL or my web app so that it only displays the two decimal places? I've looked into changing the datatype already but SMALLMONEY and MONEY have the same type of decimal values.

Thanks!

View 3 Replies View Related

Data Types

Aug 29, 2001

I am looking for a chart of SQL Server data types and information about them, such as usage, constraints, etc. Could anyone point me in the right direction?

Thanks

View 1 Replies View Related

SQL 7 Data Types

Oct 2, 2000

I'm just getting used to using SQL 7 Database and am looking for some recommendations on what DATA TYPES to use when designing tables.

The site I am working on now uses cold fusion to enter, update, and insert mainly text and articles. Now the problem with the articles is that some of them are pretty big. And when inserting or updating them, if they go over the limit of characters I get an error.

I know in access I used to use the data type "MEMO" and be able to put a large piece of info in that field.

What's the equivalent for SQL server databe?

What are the most used/common or recommended data types that should be used when putting tables together?

Thanks

George

View 2 Replies View Related

Help With Appropriate Data Types..

Nov 21, 2003

hi, i'm trying to build an online forum using sql server 2000 and coldfusion mx.

could anybody help me as to what datatypes i should use for my database fields?

i'll be using 2 simple tables to start with, ie TOPICS and POSTS. each will contain fairly basic information such as name of poster, time, data, title, message etc.

any help would be greatly appreciated.
thanx, zaffi.

View 4 Replies View Related

Data Types Help?

Jun 9, 2004

Which data type do I need to assign to my field to let users enter characters such as +=-_| etc....pretty much every single character from a standard keyboard....

thanks

View 2 Replies View Related

Need Help With Data Types

May 10, 2007

Hi,

I am pretty new with SQL and was dabbling in a test database that is linked with a software application.

I made a change to a table - Lets call this (Table1).
Table1 has a multiple columns.

Column1 is defined as numeric(9)
Column2 is defined as varchar(20)

In this case, I wanted to make all values in Column2 = Column1 that did not have a value defined so I ran the following query:

update Table1 set Column2 = Column1 where Column2 = ''

This took effect but the particular software application doesn't recognize these values because they are the wrong data type.

How can I convert all data in a column to varchar(20) if it is another data type (i.e. in this case numeric(9))?

I've tried in Enterprise manager to redesign the table and adjusted the length to 21 and then back and saved it but this did not work. I was looking at Convert and Cast functions but don't know how to write one to accomplish what I need to do here.

Half of the data in Column2 is varchar(20) and half is numeric(9).
I want all to be varchar(20).

Thanks,

asyncd

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved