Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Vs PB - with more info

Status
Not open for further replies.

docky5

Programmer
Sep 27, 2007
15
0
0
US
HI

My problem is, I select a bacnh of info from an SQL server into a datawindow and I wanted to sort them by name BUT there is a difference between the order of alphabetic order in SQL and PB. In SQL the '-' sign comes before chars but in PB it is coming after the characters.
In the query I already added the 'order by name' clause but I didn't see any affect of it in PB when It appears in the DW. The '-' character still comes later in the row then the 'a' in the PB dw.

How can I have the same order in PB as in SQL?

Thanks the help in advance.

 
Is this a 1-character field, the first character of a string, in the middle of the string, or at the end? (the "-")

If the hyphen comes at a predictable point in the string, use a computed field, and assign a integer value of 1 for "-"s, and 2 for everything else, then in your sort, sort on the computed field first.
 
Hi,
Another way I have used is to create a computed field in the datawindow asc... like: asc(sortcolum)
then add this column before your sortcolumn in the sort of the dw.

David.

:)
David
 
HI,

It sounds curious about your sorting problem. I just tryed it.
I created a datawindow (external) and inserted some rows typing in some rows with characters and '-'. sorting was ok. '-' was sorted before 'a' and before '1' etc.

It seems to be not the '-' (ascii 45) you are retrieving from database.
Insert a computed field asc( "database column") in the datawindow and insert one row into the database with a simple '-' in your database table to see what ascii character is retrieved for this value.
Maybe it is because the database table is encoded with a special character set or it is just a special character above the ascii 7-bit standard characters.

Bernd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top