Viewing 15 posts - 1,711 through 1,725 (of 3,543 total)
![]() | ...for that value to be stored in a variable... |
Use sp_executesql like this
DECLARE @result varchar(255)
SET @sql =...
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... |
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...
November 1, 2006 at 2:08 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...
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]
October 30, 2006 at 7:26 am
10-PATINDEX('%[^0]%',REVERSE(RIGHT(CAST(mynumber as varchar),9))+'1')
1,000,000 rows <=10 secs
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...
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
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 =...
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...
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/...
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)...
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...
October 20, 2006 at 2:02 am
Some table defs, sample data and actual required results would be helpful
But I consulted my Oiuja board and.....
SELECT [Category],[ProductName],[CompanyName]
FROM
(SELECT 1 AS [Category],p.[ProductName],p.[CompanyID]
FROM [Product] p...
October 19, 2006 at 7:08 am
Viewing 15 posts - 1,711 through 1,725 (of 3,543 total)