Viewing 15 posts - 406 through 420 (of 1,923 total)
If there are 20 days that they did not logout, you need all of those 20 days? and u need it for all employees?
Or u need those days that the...
March 14, 2012 at 9:17 pm
This?
DECLARE @TableA TABLE
(
EmployeeIDINT
,EmployeeLoginDateTimeDATETIME
,JobFunction VARCHAR(25)
)
INSERT @TableA
SELECT 123,'2012-02-01 01:00:24','Coding'
UNION ALL...
March 14, 2012 at 9:05 pm
Take 2! 😀
; with cte as
(
SELECT
[sort]
,[InventoryItemId]
,[WebOptionName]
,[WebCategoryId]
,[WebSubCategoryId]
,AnchorRN = ( ROW_NUMBER() OVER ( PARTITION BY T.WebCategoryId ORDER BY T.WebCategoryId , T.WebSubCategoryId ,...
March 14, 2012 at 6:53 pm
Yes sure ! ( A + B )2 = A2 + B2 + 2AB! 😀
On the other hand, convert to time = what?? time can be specified in...
March 14, 2012 at 6:42 pm
Thanks for setting up the data
Here is my 2-cents 🙂
; WITH CTE AS
(
SELECT
[sort]
,[InventoryItemId]
,[WebOptionName]
,[WebCategoryId]
,[WebSubCategoryId]
,AnchorRN = ( ROW_NUMBER() OVER ( PARTITION BY T.WebCategoryId...
March 14, 2012 at 6:03 pm
SQL_Surfer (3/14/2012)
Any help would be approciated.
Sure. But help us first!
There is menu card in that hotel! I want you to buy me a lunch from that menu card! Can you?
March 14, 2012 at 5:02 pm
How about this?
Sample data
DECLARE @Table TABLE ( DatetimeasVC VARCHAR(30) );
INSERT @Table
SELECT '10/28/2011 11:47:55.686455 AM'
UNION ALL
SELECT '9/28/2011 11:47:55.123455 AM'
UNION ALL
SELECT '11/12/2011 11:47:55.789455 PM'
UNION ALL
SELECT '10/9/2011 11:47:55.9996 AM'
UNION ALL
SELECT '1/26/2011 11:47:55.3456 PM'
UNION...
March 14, 2012 at 2:56 pm
Lynn Pettis (3/14/2012)
DECLARE @DatetimeasVC VARCHAR(30);
set @DatetimeasVC = '10/28/2011 11:47:55.686455 AM';
select convert(datetime,
substring(@DatetimeasVC, 7, 4) + substring(@DatetimeasVC, 1, 2) +...
March 14, 2012 at 2:44 pm
in the link i posted for DATETIME and DATETIME2, look at the Element Range explanation. That will tel u why ur string is not getting converted. Basically u had more...
March 14, 2012 at 12:00 pm
ishaan99 (3/14/2012)
I tried both doing a cast and convert still getting an error asConversion failed when converting datetime from character string. This is what i tried:
SELECT convert(varchar,convert(datetime,'1/6/2012 12:36:35.631951 PM'),100)
That...
March 14, 2012 at 11:57 am
Gianluca Sartori (3/14/2012)
Ah! Thanks Mr. Coffee!
No problem, Gian!
March 14, 2012 at 11:53 am
Gianluca Sartori (3/14/2012)
SELECT *
FROM (
SELECT PartId,
value,
attribute = attribute + CAST( ROW_NUMBER() OVER(PARTITION BY PartId, attribute ORDER BY PartId, attribute) AS varchar(10))
FROM (
SELECT PartID,
value =...
March 14, 2012 at 11:35 am
This?
DECLARE @DatetimeasVC VARCHAR(30) = '10/28/2011 11:47:55.686455 AM'
SELECT CAST ( @DatetimeasVC AS DATETIME2) UsingCAST ,
CONVERT(DATETIME2, @DatetimeasVC) UsingConvert
You yourself said u want to convert, why...
March 14, 2012 at 11:29 am
FROM @TempComments p1 ) D ( R_FK_HeaderID, CommentDesc, seq )
D is called table-alias.. This is dynamically assinging a name to a sub-query so that i can be referenced elswhere in...
March 14, 2012 at 11:11 am
There are lot of tables in the mix. I'm confused. But here is the code i use when i need to concatenate multiple rows into one single row.
IF OBJECT_ID('TEMPDB..#CONCAT_COLUMN_VALUES') IS...
March 13, 2012 at 9:34 pm
Viewing 15 posts - 406 through 420 (of 1,923 total)