July 20, 2010 at 11:00 am
I've table and data as follow,
declare @t1 table
(idx int, maintdte datetime);
insert into @t1 values(1,'20100723 7:40:23');
insert into @t1 values(2,'20100721 14:39:45');
insert into @t1 values(3,'20100721 11:15:05');
How to display the output as follow,
idx | maintdte
----------------------------------------
22010-07-21 14:39:45.000
32010-07-21 11:15:05.000
As you can see, the latest maintdte (20100723 7:40:23) will not be displayed
Looking for help
July 20, 2010 at 11:18 am
That will do what you asked for, but I have doupts that it is what you really want...
select *
from @t1 where maintdte != (select MAX(maintdte) from @t1)
July 20, 2010 at 11:34 am
tq sir
July 21, 2010 at 4:50 am
select *
from @t1 where maintdte < (select MAX(maintdte) from @t1)
[font="Comic Sans MS"]Praveen Goud[/font]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy