Viewing 15 posts - 76 through 90 (of 102 total)
It would be impossible to do what you ask while still returning B.Name and without performing aggregation on C.Production & D.Issued.
Assuming I understand that you would like one row returned...
November 5, 2009 at 11:23 pm
Hi,
My setup wasn't exactly like yours, but a lot of "problems" were solved by running SSMS as administrator.
November 4, 2009 at 10:45 pm
Another interesting way (don't know if I would call it a "good" way):
SELECT LEFT(RIGHT(CONVERT(CHAR(19),GETDATE(),100),7),2) + RIGHT(RIGHT(CONVERT(CHAR(19),GETDATE(),100),7),2)
-- BASED ON:
Select LTRIM(RIGHT(CONVERT(CHAR(19),GETDATE(),100),7))
edit:
I say "don't know if I would call it a "good" way"...
November 4, 2009 at 12:00 am
Just out of curiosity, do you know the client's motivation for not wanting to archive the table?
Something I have seen done:
1. Very large table broken up in to periods, maybe...
October 31, 2009 at 10:43 am
October 31, 2009 at 12:54 am
Glad I could help
Gief job in ct plz :hehe:
October 31, 2009 at 12:34 am
Good place to start:
USE YourDBName
SELECT * -- CHECK OUT ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
October 30, 2009 at 8:27 am
Copied & adapted from http://www.sqlservercentral.com/Forums/Topic811310-338-1.aspx
This is not my code, I learned something new here.
SELECT (LEN(@string) - LEN(REPLACE(@string, '~', '')))
October 29, 2009 at 11:52 pm
It can be, the two queries will return the results; mine just provides the optimizer with additional information that could affect join order. Because I have no idea what...
October 28, 2009 at 2:39 pm
Ian Scarlett (10/28/2009)
create table test (err int)
go
insert test select 0
insert test select 0
insert test select 333
insert test select 212
insert test select 22
select sum(case err when...
October 28, 2009 at 1:55 pm
Hi Flavio,
Based on that article (http://support.microsoft.com/kb/200299/en), it would seem that your error is a result of bug in a VB library.
Looking closer at your code, you are using a VB...
October 28, 2009 at 12:20 pm
Hi Flávio,
If I understand your problem correctly, when DATEDIFF(WW, StartDate, EndDate) > 52, you experience a rollover? (eg 53 => 1)
I can't seem to replicate your problem, and perhaps a...
October 26, 2009 at 11:39 pm
Hi,
Assuming that you would like your second criteria set to return the same fields:
SELECT Field1, Field2, Field3
FROM YourTable
WHERE DateField >= '12-9-2009' AND DateField < '4-17-2010'
UNION ALL
SELECT Field1, Field2, Field3
FROM YourTable
WHERE...
October 25, 2009 at 1:54 pm
You could also do this:
SELECT LEFT(YourString, (CHARINDEX('-', YourString)-1))FROM dbo.YourTable
This wouldn't require alteration should the position of your delim character ever move to the 5th position or further.
October 23, 2009 at 12:03 am
Hi there,
SQL Server 2005 has a ROW_NUMBER() function and you would use it something like this:
SELECT ROW_NUMBER() OVER (ORDER BY FLAG) AS ROWID, * FROM [Status]
For an update, it seems...
October 22, 2009 at 1:02 am
Viewing 15 posts - 76 through 90 (of 102 total)