Viewing 15 posts - 1 through 15 (of 59 total)
Actually, I was working with some big table, while coping code, I forgot to remove (nolock). Sorry for that confusion. But, I got solution what I am looking for. Thanks...
September 1, 2015 at 12:27 pm
Thanks all. Special thanks to Luis C.
I got solution with the help of Luis C.
SELECT date1, date2,
CASE
WHEN (ISNULL(date1,...
September 1, 2015 at 12:02 pm
If I use, as following, it won't throw error, but it will display 0 instead of blank.
WHEN ISNULL(date1, '1900-01-01') = '1900-01-01' THEN ''
September 1, 2015 at 10:10 am
drop table ProductHistory
CREATE TABLE ProductHistory
(
ProductName varchar(20),
Price float,
StartDate datetime,
EndDate datetime,
FlagActivePrice smallint
)
insert into ProductHistory values
('Pen',0,'01/15/2014 4:13','01/16/2014 6:15',0),
('Pen',0,'01/16/2014 6:15','12/31/9999 0:00',1),
('Book',22.57,'01/14/2014 3:15','01/15/2014 7:12',0),
('Book',23.27,'01/15/2014 7:12','01/17/2014 8:26',0),
('Book',23.27,'01/17/2014 8:26','12/31/9999 0:00',1),
('Laptop',405.29,'01/17/2014 8:00','12/31/9999 0:00',1),
('iPhone',550.29,'01/13/2014 7:15','01/14/2014 2:28',0),
('iPhone',550.29,'01/14/2014 2:28','01/15/2014...
February 7, 2014 at 1:45 pm
Thank you Keith Tate,
That's exactly I was looking for. I just put my case statement in wrong place.
Thanks.
January 31, 2014 at 9:02 am
Thank you so much twin.devil. that's 99% correct. On that I want to keep track of flag for latest price. Mean if Enddate is '12/31/9999 0:00' then put FlagActive as...
January 31, 2014 at 8:21 am
Thank you so much Mitesh Oswal,
I did that way, but it was keep on showing error in my code. Out I want in different row. Is that possible.
Thanks,
January 25, 2014 at 7:15 am
something like following;
SELECT p.[foo], p.[bar], p.[kin]
FROM
(
SELECT p.Name, o.Quantity
FROM dbo.Products AS p
INNER JOIN dbo.OrderDetails AS o
ON p.ProductID = o.ProductID
) AS...
January 23, 2014 at 10:19 pm
Thank you sir, it does make sence.
October 11, 2013 at 7:21 am
Thanks for your help.
I am very close as you suggest last time.
I did use for each loop and load all data in one table which have one column.
In T-sql,...
July 12, 2013 at 6:46 am
Hello sir, I could load data in single column in table. but I need to seperate comma
select empFirstName,len(empFirstName) - len(replace(empFirstName, ',', '')) as 'Noofcomma'
from [dbo].[test]
I can load data in...
July 10, 2013 at 10:36 pm
that sound good idea.
I will try that and let you know
July 10, 2013 at 2:22 pm
Yes, there is fix number of column, but as you suggest in Case1. How do I seperate cause just looking file name I do not know the number of column....
July 10, 2013 at 12:32 pm
No I do not have to do any transfermation. Its stright forward only load
July 10, 2013 at 12:28 pm
Viewing 15 posts - 1 through 15 (of 59 total)