Viewing 15 posts - 361 through 375 (of 2,007 total)
davidandrews13 (12/21/2012)
http://en.wikipedia.org/wiki/Sargable
and didn't quite understand this line
The typical thing that will make a sql query non-sargable is to include a function in...
December 21, 2012 at 3:54 am
Without way more information than that (see this article for what is missing[/url]), I'd be extremely surprised if anyone is able to give you an answer that doesn't just mean...
December 20, 2012 at 8:14 am
I guess I'd do it like this: -
SELECT year, week, value, ISNULL(AvgVal,0) AS AvgVal
FROM (SELECT year, week, value, ROW_NUMBER() OVER(ORDER BY year,week)
FROM year_week_value) a(year,week,value,pos)
OUTER...
December 20, 2012 at 3:41 am
Another data smudge question, seem to come in waves 🙂
SELECT currency_to, currency_from, tradedate, ad.traderate
FROM test a
CROSS APPLY (SELECT TOP 1 traderate
...
December 19, 2012 at 7:42 am
sandeepmittal11 (12/17/2012)
Refer this linkhttp://itdeveloperzone.blogspot.in/2012/11/generate-list-of-months-in-sql-server.html
Couple of issues.
1) You've replied to a thread that is over a year old.
2) You've posted a recursive CTE counting method. See this article --> http://www.sqlservercentral.com/articles/T-SQL/74118/%5B/url%5D, for...
December 18, 2012 at 3:00 am
The error is saying that there is no EMAIL column in the table User_Information.
Try this: -
SELECT name
FROM sys.columns
WHERE [object_id] = OBJECT_ID('dbo.User_Information');
That should list all of your column names for that...
December 17, 2012 at 5:04 am
If you execute this, it's at your own risk. Do it in a test environment first and make sure you understand what is going on.
DECLARE @Table_Name VARCHAR(20) = 'table 1',...
December 14, 2012 at 7:21 am
dwain.c (12/14/2012)
Cadavre - I tested the Ben-Gan approach against several others (although not one that looked like yours) and it was lightening fast.
Don't suppose you still have the test scripts?...
December 14, 2012 at 6:41 am
SELECT a.Shift+b.Shift
FROM [dbo].[Mas_Shift] a
CROSS JOIN [dbo].[Mas_Shift] b
WHERE a.ShiftId < b.ShiftId;
December 14, 2012 at 6:40 am
I must admit to only having had a quick glance at this, but couldn't you do something like this instead?
SELECT EmployeeId, MIN(LoginTime) AS LoginTime, MAX(LogOutTime) AS LogOutTime
FROM (SELECT DENSE_RANK() OVER(PARTITION...
December 14, 2012 at 3:57 am
10e5x (12/12/2012)
Thank you v much for ur help. Btw may i tried and your method returned my all 1 as numberofdays.
Oh yes u are right, i should have uploaded...
December 13, 2012 at 3:11 am
briancampbellmcad (12/12/2012)
Anyone see a problem with this query?SELECT tblTransactions.PO_Number, tblTransactions.PO_Date, tblTransactions.Quantity,
tblTransactions.Software_Description, tblTransactions.Unit_Price,
tblTransactions.SoftwareShortName, tblTransactions.Transaction_Number,
tblTransactions.Transaction_Type, tblBulkPurchases.Quantity_Remaining, tblBulkPurchases.PO_Number
FROM tblTransactions, tblBulkPurchases
WHERE FROM tblTransactions.PO_Number = tblBulkPurchases.PO_Number
ORDER BY tblTransactions.PO_Number DESC
Lots, but...
December 12, 2012 at 9:26 am
Assuming I've understood what you want, then something like this: -
SELECT StaffId,
MIN(EntryDate) AS firstDateEntrySequence, MAX(EntryDate) AS lastDateEntrySequence,
DATEDIFF(dd,MIN(EntryDate),MAX(EntryDate))+1 AS NumberOfDaysInSequence
FROM (SELECT StaffId, EntryDate,
DATEADD(dd, - ROW_NUMBER()...
December 12, 2012 at 9:16 am
murthyvs (12/11/2012)
Can your code take two row terminators? pipe (|) and line break ()?
Example data:
field1;field2|
30;38469|
31;38469|
32;38469|
33;38469|
34;38469|
I didn't notice the line break in the original data. Very...
December 11, 2012 at 9:20 am
olivia.forde (12/11/2012)
Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'join'.
Msg 102, Level 15, State 1, Line 14
Incorrect syntax near...
December 11, 2012 at 8:46 am
Viewing 15 posts - 361 through 375 (of 2,007 total)