Viewing 15 posts - 2,281 through 2,295 (of 15,381 total)
Luis Cazares (9/17/2015)
CREATE TABLE Testing
(
VHRGDT numeric(8, 0) NOT NULL,
VHRGTM numeric(6, 0) NOT NULL
)
INSERT INTO Testing
SELECT TOP 1000000
CONVERT(...
September 17, 2015 at 9:00 am
Jeff Moden (9/17/2015)
Sean Lange (9/17/2015)
September 17, 2015 at 8:55 am
Ed Wagner (9/17/2015)
Jeff Moden (9/17/2015)
September 17, 2015 at 8:27 am
Kristen-173977 (9/16/2015)
September 17, 2015 at 8:10 am
Eric M Russell (9/17/2015)
September 17, 2015 at 7:53 am
Ed Wagner (9/17/2015)
To test it, I created a table with column names that don't remind me of days past. Sean, I think you know what I'm talking about. 😉
I...
September 17, 2015 at 7:32 am
In case anybody is interested I compiled all the suggestions into a single query just so you can see them side by side. 😉
select DesiredDateTimeValue
, cast(FORMAT(VHRGDT, '0000-00-00') + ' '...
September 17, 2015 at 7:29 am
tripleAxe (9/17/2015)
SELECT
DATEADD(SECOND, CONVERT(INT, SUBSTRING(RIGHT('0' +(CONVERT(VARCHAR(6), VHRGTM)),6),1,2)) * 60 * 60 + CONVERT(INT, SUBSTRING(RIGHT('0' +(CONVERT(VARCHAR(6), VHRGTM)),6),3,2)) * 60...
September 17, 2015 at 7:25 am
Jeff Moden (9/16/2015)
Sean Lange (9/16/2015)
drew.allen (9/16/2015)
Try the FORMAT function. It was added in SQL 2012.
SELECT FORMAT(vhrgdt, '0000-00-00') + ' ' + FORMAT(vhrgtm, '00:00:00.000'), *
FROM #Something s
Drew
Thanks Drew. I don't use...
September 17, 2015 at 7:06 am
drew.allen (9/16/2015)
Try the FORMAT function. It was added in SQL 2012.
SELECT FORMAT(vhrgdt, '0000-00-00') + ' ' + FORMAT(vhrgtm, '00:00:00.000'), *
FROM #Something s
Drew
Thanks Drew. I don't use FORMAT very often but...
September 16, 2015 at 3:37 pm
Manic Star (9/16/2015)
one proc to rule them
one proc to bind them
one proc to bring them all and in the darkness, deadlock them
'precious...
September 16, 2015 at 2:33 pm
Lynn Pettis (9/16/2015)
Kristen-173977 (9/16/2015)
Sean Lange (9/16/2015)
But surely you aren't joining on these string values right???
Correct. Main thing I would be expecting to find would be an @MyColumn parameter to an...
September 16, 2015 at 1:30 pm
Kristen-173977 (9/16/2015)
P.S. On the day that that one ACTUALLY comes up I will be ROYALLY pissed off!!
LOL true dat!!!
September 16, 2015 at 12:42 pm
Kristen-173977 (9/16/2015)
Sean Lange (9/16/2015)
This is where consistently using aliases has some advantages. Maybe Staff is st and Supplier is su. ... What I really don't like about prefixes is it...
September 16, 2015 at 12:18 pm
Kristen-173977 (9/16/2015)
Sean Lange (9/16/2015)
c.FirstName is obviously the Customer table but s.FirstName indicates the Staff table.
For me, that's where it starts to fall down. I don't know if S is...
September 16, 2015 at 10:22 am
Viewing 15 posts - 2,281 through 2,295 (of 15,381 total)