Viewing 15 posts - 1,711 through 1,725 (of 3,544 total)
| ...if you were to write this as a normal stored procedure what would it look like... |
You cannot, that...
Far away is close at hand in the images of elsewhere.
Anon.
November 6, 2006 at 7:37 am
| ...for that value to be stored in a variable... |
Use sp_executesql like this
DECLARE @result varchar(255)
SET @sql =...
Far away is close at hand in the images of elsewhere.
Anon.
November 6, 2006 at 6:45 am
| But you also need to look up the ISO-8601 format for temproal data so you will not use... |
Far away is close at hand in the images of elsewhere.
Anon.
November 1, 2006 at 8:15 am
Then add a GROUP BY and HAVING like
SELECT loi.LOB_ID, loi.EUS_ID, loi.LOI_START_DATE, loi.LOI_END_DATE, eu.CTY_CODE
FROM @learning_object_instances loi
JOIN @end_users eu ON eu.EUS_ID = loi.EUS_ID
WHERE eu.CTY_CODE = 'RU' and loi.LOI_START_DATE...
Far away is close at hand in the images of elsewhere.
Anon.
November 1, 2006 at 2:08 am
DATEADD(day, -1, '31/10/2006')
Far away is close at hand in the images of elsewhere.
Anon.
October 31, 2006 at 7:24 am
Agree, requirements are unclear
As far as I can determine
SELECT i.LOB_ID, i.EUS_ID, i.LOI_START_DATE, i.LOI_END_DATE, u.CTY_CODE
FROM learning_object_instances i
CROSS JOIN end_users u
WHERE u.CTY_CODE = 'RU' AND i.LOI_START_DATE > 'September 7, 2006'
GROUP...
Far away is close at hand in the images of elsewhere.
Anon.
October 31, 2006 at 7:04 am
Not withstanding Jeff's comments
if all the names are the same format
PARSENAME(REPLACE(REPLACE(full_name,',',''),' ','.'),2) AS [First_Name],
PARSENAME(REPLACE(REPLACE(full_name,',',''),' ','.'),1) AS [Middle_Name],
PARSENAME(REPLACE(REPLACE(full_name,',',''),' ','.'),3) AS [Last_Name]
Far away is close at hand in the images of elsewhere.
Anon.
October 30, 2006 at 7:26 am
10-PATINDEX('%[^0]%',REVERSE(RIGHT(CAST(mynumber as varchar),9))+'1')
1,000,000 rows <=10 secs
Far away is close at hand in the images of elsewhere.
Anon.
October 26, 2006 at 7:46 am
This type of problem has occurred in a number of threads on this site with various answers, one of which is to do calculus on the days of the week by...
Far away is close at hand in the images of elsewhere.
Anon.
October 23, 2006 at 9:13 am
DATEDIFF(hour, date1, date2) - (DATEDIFF(week, date1, date2) * 48)
providing date1 and date2 are not sat/sun dates
Far away is close at hand in the images of elsewhere.
Anon.
October 23, 2006 at 7:24 am
Don't know what coding that is but my guess for a solution would be
CREATE PROCEDURE TopCustomerValue2
@TopCompany CHAR(36) OUTPUT,
TopValue INT OUTPUT)
AS
SELECT TOP 1 @TopCompany =...
Far away is close at hand in the images of elsewhere.
Anon.
October 23, 2006 at 7:11 am
In that case go back to my original solution and expand it
DECLARE @index int
SET @String = REPLACE(@String,' ','')
SET @index = PATINDEX('%Period:[0-9][0-9/][0-9/]%',@String)
SET @String = STUFF(@String,1,@index + 6,'')
SET...
Far away is close at hand in the images of elsewhere.
Anon.
October 20, 2006 at 8:44 am
OK then
SELECT
CAST(LEFT(STUFF([String],1,PATINDEX('%Period: [0-9/ ][0-9/ ][0-9/ ]%',[String])+7,''),PATINDEX('%[^0-9/ ]%',STUFF([String],1,PATINDEX('%Period: [0-9/ ][0-9/ ][0-9/ ]%',[String])+7,''))-1) as datetime) AS [FirstDate],
CAST(LEFT(SUBSTRING([String],PATINDEX('%Period: [0-9/ ][0-9/ ][0-9/ ]%',[String])+7+PATINDEX('%[^0-9/ ]%',STUFF([String],1,PATINDEX('%Period: [0-9/ ][0-9/ ][0-9/ ]%',[String])+7,''))+2,255),PATINDEX('%[^0-9/ ]%',SUBSTRING([String],PATINDEX('%Period: [0-9/ ][0-9/ ][0-9/...
Far away is close at hand in the images of elsewhere.
Anon.
October 20, 2006 at 7:56 am
I agree with Vladan that it is over complicated
I believe this would achieve the same
SET DATEFORMAT DMY
SET @String = REPLACE(@String,' ','')
SET @String = SUBSTRING(@String,PATINDEX('%to[0-9][0-9/][0-9/]%',@String)+2,255)
SET @String = LEFT(@String,PATINDEX('%[^0-9/]%',@String)-1)...
Far away is close at hand in the images of elsewhere.
Anon.
October 20, 2006 at 7:08 am
| ...don't have the budget to create a data warehouse... |
Know that as well, but if you could ever get...
Far away is close at hand in the images of elsewhere.
Anon.
October 20, 2006 at 2:02 am
Viewing 15 posts - 1,711 through 1,725 (of 3,544 total)