Forum Replies Created

Viewing 15 posts - 16 through 30 (of 40 total)

  • RE: Constructing a query

    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.

  • RE: Type

    Thanks a lot.......

  • RE: Type

    Can a type declared as NOT NULL accept NULL values?

  • RE: DateTime Format

    What???????????????????

  • RE: DateTime Format

    What is the error that occurs?

  • RE: DateTime Format

    Select FirstName, LastName, Convert(varchar(10),LogDate,126)LogDate

    FROM Employee

    Where datediff(d,LogDate,'2010-04-20')=0

  • RE: DateTime Format

    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...

  • RE: DateTime Format

    Try this:

    Select FirstName, LastName, Convert(varchar(10),LogDate,126)LogDate

    FROM Employee

    Where datediff(d,LogDate,''2010-04-20'')=0

  • RE: Length

    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...

  • RE: How to update multiple tables in one statement ?

    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...

  • RE: How to have cummulative sum of a column values based upon a condition?

    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...

  • RE: top 5th to 10 th record of a table

    You can use this method:

    WITH Reservation AS

    (

    SELECT ResId,GuestName,

    ROW_NUMBER() OVER (ORDER BY ResId) AS 'RowNumber'

    FROM ResInfmas

    )

    SELECT *

    FROM...

  • RE: Help required to write this query

    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)

  • RE: Help required to write this query

    instead of 2010,you can use year(getdate())

    🙂

  • RE: Help required to write this query

    you can use the getdate() function.I hard coded ot just to test ..

    🙂

Viewing 15 posts - 16 through 30 (of 40 total)