Viewing 15 posts - 31 through 45 (of 139 total)
Hi Edward,
Another good way. Thanks.
But i feel
select convert(datetime,convert(varchar,getdate(),112))
is better and easier to understand.
But whtz abt performance?:w00t:
September 23, 2009 at 6:42 am
Matt Whitfield (9/22/2009)
Erm... there is another way - check out ROW_NUMBER, OVER clauses and the PARTITION BY statement.
Hi Matt,
Can u describe some more on those issue?
September 22, 2009 at 11:25 pm
Steved,
Great help. So, there is no way apart from INNER join...anyway, that's fine for me.
Thanks again.
September 22, 2009 at 6:52 am
mroja_2005 (9/22/2009)
In my scenario, the second create index statement is giving me better performance.
Conceptually, what is difference??? Why do we...
September 22, 2009 at 6:44 am
steveb. (9/22/2009)
select name, value, version from #temp
where name in (select name as version from #temp group by name)
AND version in (select max(version) as...
September 22, 2009 at 6:34 am
Hi,
1 more question:
Shall I do the same with IN? (Plz dont ask why, its simply fro knowlwdge)
I have used the following query, but its giving syntax error:
select name, value, version...
September 22, 2009 at 5:29 am
Hi Steveb,
Thanks 4 ur reply.
This is exactly what I need.
Thanks again.
September 22, 2009 at 4:51 am
Fausto Echevarria (9/18/2009)
i think this is what you want..select convert(datetime,convert(varchar,getdate(),112))
and you will get this...
-----------------------
2009-09-18 00:00:00.000
(1 row(s) affected)
Hi Fausto,
That is exactly my wantsome. Thanks a ton.
September 21, 2009 at 11:27 pm
Fausto Echevarria (9/18/2009)
i think this is what you want..select convert(datetime,convert(varchar,getdate(),112))
and you will get this...
-----------------------
2009-09-18 00:00:00.000
(1 row(s) affected)
Hi Fausto,
That is exactly my wantsome. Thanks a ton.
September 21, 2009 at 11:24 pm
Dugi (9/18/2009)
SELECT * FROM Fiscal_Year
WHERE CONVERT (varchar(10),'2009-09-01 00:00:00.000', 112)
BETWEEN CONVERT(varchar(10), start_date,112) AND CONVERT(varchar(10),(end_date - 1),112)
SELECT * FROM Fiscal_Year
WHERE '2009-09-01 00:00:00.000'
BETWEEN start_date AND (end_date - 1)
'2009-09-01 00:00:00.000' -...
September 18, 2009 at 5:12 am
Dugi (9/18/2009)
When you use the CONVERT function try to not determine the number of characters during conversationstry like this CONVERT(VARCHAR, DATE_FIELD, format)!
Hi Dugi,
There is no difference if we are not...
September 18, 2009 at 4:08 am
Dave Ballantyne (9/18/2009)
Try this linkhttp://www.sqlservercentral.com/blogs/lynnpettis/archive/2009/03/25/some-common-date-routines.aspx
Hi Dave,
It works fine. Even I have used the following code
declare @start_date varchar(23)
select @start_date = REPLACE((CONVERT (varchar(10), '2008-10-09 00:00:00.000',112) + ' 00:00:00.000'),'-','/')
print @start_date
But I feel ur...
September 18, 2009 at 3:48 am
Dugi (9/18/2009)
The solution is hereThis thread should be closed!
➡
Hi Dugi,
its a server error, thats why posted twice. Anyway got the solution, thanks.
September 18, 2009 at 3:36 am
Mahesh Bote (9/1/2009)
[font="Verdana"]To do this you need to use Dynamic SQL inside the SProc.Mahesh[/font]
Thnaks mahesh for ur reply...I wll try the method.
September 1, 2009 at 12:08 am
Mahesh Bote (8/31/2009)
arup_kc (8/27/2009)
You cant call a function from a SELECT statement and send a column name as a parameter.
Shall we sens a column name as a parameter in...
August 31, 2009 at 11:27 pm
Viewing 15 posts - 31 through 45 (of 139 total)