Viewing 15 posts - 9,676 through 9,690 (of 10,144 total)
Christopher Stobbs (8/7/2008)
HI Chris,I copied your code straight into a a query window and here are the results I code
TheValue(No column name)
132132
873873
969969
Thanks Chris...how odd! I've tested it here several times...
August 7, 2008 at 6:24 am
Christopher Stobbs (8/7/2008)
HI Chris,Your solution does not work.
The TOP 100 PERCENT is messing with your results.
If you make TOP 100000 then it works
Interesting...it works with the (albeit limited) set of...
August 7, 2008 at 6:07 am
-- Create a function
CREATE FUNCTION [dbo].[uftSortString]
(
@String NVARCHAR(100)
)
RETURNS NVARCHAR(100)
AS
BEGIN
DECLARE @ReturnValue NVARCHAR(20)
SET @ReturnValue = ''
SELECT @ReturnValue = @ReturnValue + d.TheValue
FROM (SELECT TOP 100 PERCENT CAST(SUBSTRING(@String,number,1) AS CHAR(1)) AS...
August 7, 2008 at 5:27 am
Hello
You want to sort the data in the string, as opposed to sorting the column.
So the value '132' becomes '123' etc
What is the maximum length of string values found in...
August 7, 2008 at 4:27 am
It's still really difficult to tell what's supposed to be happening here because the use of variables doesn't necessarily make any sense. It would help people a great deal if...
August 6, 2008 at 1:57 am
You need a BEGIN / END block between IF and ELSE if the IF is followed by more than one statement.
August 5, 2008 at 9:15 am
jeordonez (8/4/2008)
Gianluca,Almost there, unfortunately we are not on SQL 2005 yet so ROW_NUMBER() doesn't work.. :(. is there an equivalent to this for 2000???
Yep:
SELECT i.*
FROM #InventoryStage i
INNER JOIN (SELECT...
August 4, 2008 at 12:55 pm
Hi Jeordonez
A picture tells a thousand words...
CREATE TABLE #InventoryStage(
[SerialNumber] [varchar](20) NULL,
[TagNumber] [varchar](8) NULL,
...
August 4, 2008 at 10:35 am
DROP TABLE #Dates
CREATE TABLE #Dates (CreateDate DATETIME)
INSERT INTO #Dates (CreateDate)
SELECT '01/01/2008' UNION ALL
SELECT '02/01/2008' UNION ALL
SELECT '03/01/2008' UNION ALL
SELECT '04/01/2008' UNION ALL
SELECT '05/01/2008' UNION ALL
SELECT '06/01/2008' UNION ALL
SELECT '07/01/2008' UNION...
August 4, 2008 at 10:10 am
declare @Return varchar(30), @String varchar(30)
set @Return = ''
set @String = 'CHARLES H#L6CAL JOEL4'
SELECT @Return = @Return + SUBSTRING(@String,number,1)
FROM dbo.Numbers WITH (NOLOCK)
WHERE number <= LEN(@String)
AND UPPER(SUBSTRING(@String,number,1)) LIKE '%[^A-Z]%'
SELECT CASE WHEN...
August 4, 2008 at 9:16 am
How about a little more information? What do you want to do if the string contains something other than a letter? Such as
report an error
not import the row into a...
August 4, 2008 at 9:00 am
Test the SELECT on its own:
SELECT c.academic_year, c.faculty, c.faculty_description, c.department_code,
c.department_description, c.course_level_code, c.location_of_study, c.location_of_study_description,
c.franchise_flag, c.source_of_funding_hesa, c.Residential_Status_Code, c.residential_status_description,
c.Course_Code, c.course_mode_of_study_hesa
FROM tblStudent_Course c
INNER JOIN tblNew_Entrants n
...
August 4, 2008 at 8:03 am
Hi Jude
Can you please post the code you ran, with the error message?
Please also post:
The list of columns you want populated in the registration table
The list of columns from the...
August 4, 2008 at 7:45 am
Viewing 15 posts - 9,676 through 9,690 (of 10,144 total)