Viewing 15 posts - 406 through 420 (of 516 total)
Try putting Year end date as first friday of next year and check the results.
And I am not able to see your screen attachment, Please post again.
Thanks
July 28, 2012 at 5:04 am
One more thing, i missed above
DECLARE @year_start DATETIME = '02-JAN-2012' --First Monday of the year
DECLARE @year_end DATETIME = '31-DEC-2012'
@Year_start is the first Monday of the year. End...
July 28, 2012 at 4:03 am
Here you go....
I have modified the Data Script to add one more week for both Microsoft and Infosys
CREATE TABLE NseData
(
symbolid bigint,
symbol varchar(200),
stimestamp datetime,
sopen numeric(18, 2),
shigh numeric(18, 2),
slow numeric(18, 2),
sclose numeric(18,...
July 28, 2012 at 4:00 am
Jpotucek (7/27/2012)
select * from iaxChecksCurrent where cast(UploadDate as varchar(10)) like '%2012-07-18%'
This returned zero rows
SELECT * FROM iaxChecksCurrent
WHERE
CONVERT(varchar(10),UploadDate,120) =...
July 28, 2012 at 2:56 am
Lokesh Vij (7/28/2012)
select empid,
datepart(yyyy,orderdate) [Year],
datepart(mm,orderdate) [Month]
,SUM(qty) [TotalQty]
from Orders
Group by empid,datepart(yyyy,orderdate),datepart(mm,orderdate)
WITH ROLLUP;
Needless to say, you need to expend this in you pivot for your result.
July 28, 2012 at 1:22 am
select empid,
datepart(yyyy,orderdate) [Year],
datepart(mm,orderdate) [Month]
,SUM(qty) [TotalQty]
from Orders
Group by empid,datepart(yyyy,orderdate),datepart(mm,orderdate)
WITH ROLLUP;
July 28, 2012 at 1:21 am
As you are new to this forum try to know the best practices in order to get quicker answers on T-SQL questions, Follow this link
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Cheers
Lokesh
July 28, 2012 at 1:09 am
CREATE TABLE NseData
(
symbolid bigint,
symbol varchar(200),
stimestamp datetime,
sopen numeric(18, 2),
shigh numeric(18, 2),
slow numeric(18, 2),
sclose numeric(18, 2),
tottrdqty bigint
)
INSERT INTO NseData
VALUES
(1,'Microsoft','Jul, 23 2012',42.00,43.5,38.25,43,10),
(1,'Microsoft','Jul, 24 2012',43.25,44.75,39.50,44.25,20),
(1,'Microsoft','Jul, 25 2012',44.50,46.00,40.75,45.50,30),
(1,'Microsoft','Jul, 26 2012',45.75,47.25,42.00,46.75,10),
(1,'Microsoft','Jul, 27 2012',47.00,48.50,43.25,48.00,20),
(2,'Infosys','Jul, 23 2012',48.25,49.75,44.50,49.25,30),
(2,'Infosys','Jul,...
July 28, 2012 at 1:06 am
Alan Kwan (7/27/2012)
Just tried the code you provided, still the same error.SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0; Database = C:\abc.eeee.xls', 'Select * FROM [Sheet1$]')
Same Error 🙁
Try using SSIS then. Its...
July 28, 2012 at 12:09 am
First of all, your table ISIR should have enr_id added otherwise it does not make any sense to have two dateadded fields for one stu_id
Here is one more way to...
July 27, 2012 at 11:36 pm
Wonderful article Capn. Thanks for sharing.
July 27, 2012 at 7:42 pm
lrutkowski (7/27/2012)
July 27, 2012 at 1:19 pm
Few days back, I posted how to combine two consecutive rows and find result. Pls have a look, might be useful:
http://sqlpathy.wordpress.com/2012/07/22/operating-on-consecutive-rowscolumns/
I am sure there are many ways of doing a...
July 27, 2012 at 1:14 pm
Yes agreed. This can only be used for datetime.
I was just trying to show one more way of doing it 🙂
July 27, 2012 at 1:07 pm
Sean Lange (7/26/2012)
capn.hector (7/26/2012)
vchandm23 (7/25/2012)
@whereSql nvarchar(256)
AS
EXEC('SELECT [fields] FROM WHERE ' + @whereSql)
GO
From stackOverflow website. This is what i was looking for. I am...
July 27, 2012 at 1:03 pm
Viewing 15 posts - 406 through 420 (of 516 total)