Viewing 15 posts - 2,656 through 2,670 (of 3,957 total)
kk 93815 (10/2/2012)
Thanks laurie. we are using 2005
I think both solutions should run on SQL 2005.
October 2, 2012 at 4:57 am
kk 93815 (10/2/2012)
dwain.c i like your approach as it's bit simple but please can you give some explanation so that it makes more sense to me......
October 2, 2012 at 4:56 am
ColdCoffee (10/1/2012)
You code should be
IF @MyNumberReturn = '000000' OR @MyNumberReturn IS NULLTHEN
PRINT 'NOTHING'
ELSE
<DO SOMETHING>
Equivalent should be:
IF ISNULL(@MyNumberReturn, '000000') = '000000' THEN
...
October 2, 2012 at 4:35 am
L' Eomot Inversé (10/2/2012)
Nice question. Made me think.
Thanks for giving it a shot Tom.
Looks like you changed your avatar and signature.
October 2, 2012 at 4:32 am
DECLARE @Table1 TABLE
(Month2Date VARCHAR(15), Yesterday VARCHAR(15), PrevMonth VARCHAR(15))
INSERT INTO @Table1
SELECT 'Month to Date', 'Yesterday', 'PrevMonth'
SELECT * FROM @Table1
Not trying to be funny here (OK maybe a...
October 2, 2012 at 4:30 am
Record 1 is also part of the group defined for 2 and 3 (groupid 50) and you didn't say how you wanted that to be handled (unless ignoring as you...
October 2, 2012 at 4:19 am
kapil190588 (10/2/2012)
October 2, 2012 at 2:21 am
Davin21 (10/2/2012)
Is there any specific reason when we do the following
DECLARE @Date1 DATETIME SET @Date1= '2012-08-28 11:53:00'
select CAST(cast(@Date1 AS float) AS DATETIME)
That we lose 3 ms in the process...
October 2, 2012 at 1:40 am
kapil190588 (10/2/2012)
DECLARE @Date1 DATETIME = '2012-08-28 11:53:00'select cast(@Date1 AS int)
It gives the result 41147. Can anyone tell me how this conversion is done.
There are 41147 days between 1900-01-01 and...
October 2, 2012 at 1:27 am
You may want to take a look at this article, by our own, beloved Joe Celko: http://www.simple-talk.com/sql/t-sql-programming/contiguous-time-periods/
October 1, 2012 at 7:11 pm
Looks darn near a tie to me, but if you're buying the beers on our next fishing trip, I'll concede to your snapper.
October 1, 2012 at 9:12 am
If you just need hours (from the truncated startdatetime):
DATEDIFF(hour, DATEADD(day, DATEDIFF(day, 0, EndDateTime), 0), EndDateTime)
If you need like HH:MM:SS, that's a bit more challenging but doable.
October 1, 2012 at 5:58 am
If you want to get fancy-smancy, you could do it like this:
CREATE TABLE #Users
(UserID VARCHAR(20) NOT NULL
,Created_DT DATETIME DEFAULT (GETDATE())
...
October 1, 2012 at 5:53 am
In that case, the startdate just becomes the end date truncated to midnight:
SELECT *
,NewStartDT=DATEADD(day, DATEDIFF(day, 0, EndDateTime), 0)
FROM #sampleData
October 1, 2012 at 4:40 am
GilaMonster (10/1/2012)
Err... 1433 being the default port for SQL Server and 1434 being the UDP broadcast port?
Ahhh... enlightnment can be a scary thing.
October 1, 2012 at 4:38 am
Viewing 15 posts - 2,656 through 2,670 (of 3,957 total)