Viewing 15 posts - 136 through 150 (of 216 total)
hey!!
it is working fine man.
select convert(smalldatetime,'18/01/1976',103)
BUT DATE EARLIER THAN 1900 WILL CAUSE A PROBLEM.!!
Regards
AMIT GUPTA
March 2, 2006 at 9:35 am
HI,
Sorry!!
I don't see the GroupValue i think for a particular groupid ,it contains same kind of value.
You can Try this one::-
select groupID, (select groupValue from tbl1 where dateCreated=(select max(dateCreated) from...
March 2, 2006 at 9:25 am
hi,
You can detach your database only when if it is not used by someone
or by some application.
Regards
Amit Gupta.
March 2, 2006 at 9:16 am
If you want to delete records by 100 then you can use::
Delete t from table_name t join
(select top 100 * from table_name ) t1
on t.col1=t1.col1
where your condition
Regards
Amit Gupta
March 2, 2006 at 9:05 am
Use this simple Query:-
select groupID, groupValue, max(dateCreated)
from tbl1
group by groupID, groupValue
order by groupID ASC, dateCreated DESC
Regards
Amit Gupta
March 2, 2006 at 8:58 am
No,
For this you have to depend on the system table and which is not a good practice
and alse it will not work in case of views.
March 2, 2006 at 5:06 am
HI,
I HAVE SOLVED YOUR PROBLEM.
NOW IT WILL WORK IN BOTH CASES I.E. IN TABLES AND ALSE IN VIEWS.
for this you have to create a Table first,
Create Table tbl_v
(
i_val int
)
PASS...
March 2, 2006 at 4:01 am
If a table exists, then you can't drop the index.
if that particular table is deleted then its index will be deleted.
Regards
Amit Gupta
March 1, 2006 at 7:44 am
NOW I have siligtly change my function,
i hope that it will provide to you better result in case of tables then it will think about the views.
Alter FUNCTION Get_Rows(@tbl varchar(100)) returns...
March 1, 2006 at 7:33 am
Hi,
use this function which takes the table name
and returns the number of rows
CREATE FUNCTION Get_Rows(@tbl varchar(100)) returns int
as
Begin
Declare @i int
select @i=sum(rows)
from sysindexes where id=object_id(@tbl)
group by id
return @i
End
select dbo.Get_Rows('summary')
Out Put...
March 1, 2006 at 7:06 am
Hi,
Use the following function which takes hours as input and returns the desired output to you..
Create FUNCTION Get_Day_Hour(@hr int) Returns Varchar(50)
as
Begin
Declare @Result varchar(250)
if substring(convert(varchar,convert(numeric(18,3),@hr)/24),1,patindex('%.%',convert(varchar,convert(numeric(18,3),@hr)/24))-1) > 0
Begin
set @result=convert(varchar,substring(convert(varchar,convert(numeric(18,3),@hr)/24),1,patindex('%.%',convert(varchar,convert(numeric(18,3),@hr)/24))-1)) + '...
March 1, 2006 at 6:02 am
HI,
I think it will realyhelp you to find a problem of your answer!!
SELECT CONVERT(DATETIME,CONVERT(VARCHAR,'2006-03-01',121) + ' 11:25:25.526 ',121)
I have add the time part to a date field which i have...
March 1, 2006 at 5:18 am
Hi,
Is this is your Answer ?
select * from products where category_id
in(select category_id from products)
Regards
AMIT GUPTA
March 1, 2006 at 4:50 am
HI,
use case in your update query.It is better rather to create a function because you can't use the update statement in your functions
Regards
Amit
March 1, 2006 at 4:34 am
Viewing 15 posts - 136 through 150 (of 216 total)