Viewing 15 posts - 16 through 30 (of 40 total)
Yes,You seem to be filling up a single table with lot of fields.Just split up the table and create new one as Gila suggested.
May 16, 2011 at 12:37 am
Select FirstName, LastName, Convert(varchar(10),LogDate,126)LogDate
FROM Employee
Where datediff(d,LogDate,'2010-04-20')=0
April 20, 2011 at 1:57 am
Sorry friend,
The error might be due to the double quotes that appear before the date parameter.This occurred when i copied the query from query analyzer.Please change it as '2010-04-20' instead...
April 20, 2011 at 1:57 am
Try this:
Select FirstName, LastName, Convert(varchar(10),LogDate,126)LogDate
FROM Employee
Where datediff(d,LogDate,''2010-04-20'')=0
April 20, 2011 at 12:38 am
I too have answered it as '4',but the answer is based on nchar(30) whereas the question is for nvarchar(30).This is really unfair to all those who answered '4' instead of...
April 8, 2011 at 12:37 am
If you are insisting,you can use case statement.Consider the following example:
---------------------------------------------------------------------
create table #tblGuest (Guestid integer ,Fname varchar(20),Lname varchar(20),Date datetime,employeeid integer)
create table #tblEmployee (employeeid integer ,Fname varchar(20),Lname varchar(20),employeecode varchar(30))
insert into...
September 20, 2010 at 11:33 pm
I am not sure about the performance of this solution,but hope this may help you.
The data supplied by you does not contain a unique id.This works only if there such...
September 16, 2010 at 11:44 pm
You can use this method:
WITH Reservation AS
(
SELECT ResId,GuestName,
ROW_NUMBER() OVER (ORDER BY ResId) AS 'RowNumber'
FROM ResInfmas
)
SELECT *
FROM...
July 22, 2010 at 10:57 pm
you can change it like this:
select qId,datename(mm,@CurDate)
from @TmpTbl where datename(MM,@CurDate)in (qFrom,datename(mm,dateadd(m,1,'01 '+qFrom+' '+cast(year(@CurDate) as varchar))),qTo)
select qId--,datename(MM,dateadd(m,-1,@CurDate))
from @TmpTbl where datename(MM,dateadd(m,-1,@CurDate))in (qFrom,datename(mm,dateadd(m,1,'01 '+qFrom+' '+cast(year(@CurDate) as varchar))),qTo)
May 19, 2010 at 5:02 am
instead of 2010,you can use year(getdate())
🙂
May 19, 2010 at 4:58 am
you can use the getdate() function.I hard coded ot just to test ..
🙂
May 19, 2010 at 4:58 am
Viewing 15 posts - 16 through 30 (of 40 total)