Viewing 15 posts - 106 through 120 (of 1,923 total)
This?
select * , rn = ROW_NUMBER() over (order by ssn) + 1000
from person
May 24, 2012 at 2:22 pm
How about this?
DECLARE @QueryDate DATETIME = '2012-07-01'
SELECT mpd.Product
, mpd.FridayDate
, mpd.MondayDate
FROM ...
May 24, 2012 at 2:36 am
dwain.c (5/23/2012)
Chrissy,Yes you do need a Tally table, but I don't think you need that many CROSS APPLYs.
Dwain, if you watch closely, those CROSS APPLYs are not on Tally tables;...
May 23, 2012 at 7:13 pm
This?
DECLARE @Now DATETIME = DATEADD(DD, DATEDIFF(DD, 0 , GETDATE() ), 0)
SELECT C.Company
, C.StartDate
...
May 23, 2012 at 5:55 pm
CLR Time 😀
Before we proceed, i am total newbie to CLR and C# and built this sitting this morning 😎
without further ado, here is the C# code:
using System;
using System.Data;
using System.Text;
using...
May 22, 2012 at 5:48 pm
Confusing Queries (5/22/2012)
No, I am not looking for this.I want the numbers with a columns shifted according to the order.
Can you elaborate on the problem? I am really...
May 22, 2012 at 10:43 am
SELECT *
FROM #Number
ORDER BY Num ASC
Just add teh ORDER BY clause..
May 22, 2012 at 10:30 am
1. The format is of DATETIME2 and not DATETIME.
2. You have dots as the separator for the time component instead of colons. A valid date will look like : ...
May 19, 2012 at 12:48 pm
Suresh B. (5/18/2012)
Prasad.N (5/18/2012)
i have doubt regarding select statement, i have one table with 46 columns , i want select only 42 columns.but iam not like to write
select...
May 18, 2012 at 12:11 am
Do you know the names of the 4 columns that you wanna exclude?
You can use dynamic sql to do that, if you know the names of the columns u wanna...
May 18, 2012 at 12:03 am
What is the original requirement?
May 17, 2012 at 10:35 pm
Jay Pete (5/17/2012)
Cold Coffee,Is there any other work around instead of using of cross apply?
Please share your thoughts? Just curious to know..
Yes, just replace CrsApp.Dt with dateadd(DD, -1 , dateadd(MM,...
May 17, 2012 at 9:45 pm
codebyo (5/17/2012)
How about this:
SELECT TMP.lastDay,
CASE (DATEPART(dw, tmp.lastDay) + @@DATEFIRST) % 7
Be careful while using @@DateFirst. It is affected by the Language setting of...
May 17, 2012 at 9:31 pm
Try this:
declare @YearStart datetime = '01-Jan-2012'
; with numbers as
( select top 12 n = row_number() over(order by (select null))
from sys.columns
)
select LastDayOfEachMOnth = CrsApp.Dt
...
May 17, 2012 at 9:24 pm
Viewing 15 posts - 106 through 120 (of 1,923 total)