Forum Replies Created

Viewing 15 posts - 17,716 through 17,730 (of 18,926 total)

  • RE: GETDATE() -vs- fn NOW()

    I agree that it returns the same thing.. but I can't find any reference of it in the books online nor yahoo... So I guess it's an undocumented command...

  • RE: Date Conversion

    This means that the data is incorrectly formated in the column.

    Can you run this query and send me the results?

    Select * from dbo.YourTable where IsDate(VarcharDateCol) = 0

    BTW, those are the...

  • RE: GETDATE() -vs- fn NOW()

    Actually now() is not a standard sql function.. are you sure that now is note a view or a user defined function that returns the getdate() value??

  • RE: How to return a quarter for every person

    Actually what Farrell proposed is the same solution than mine with an older syntaxe, if you don't specify a join in a query with multiple tables, then a cross join...

  • RE: Problem with Creating Dynamic T-SQL...

    first problem :

    move the 2nd to last parenthesis inside the last quote.

    2nd you can set the local variable with the exec statement, you'll have to lear how to use...

  • RE: How to return a quarter for every person

    You mean something like this?

    Select O.name, dtQuarters.DateStart, dtQuarters.DateEnd from dbo.SysObjects O cross join

    (

    Select '2005/01/01' as DateStart, '2005/03/31' as DateEnd

    union all

    Select '2005/04/01' as DateStart, '2005/06/30' as DateEnd

    union all

    Select '2005/07/01' as DateStart,...

  • RE: Date Conversion

    Is the date kept in a date column a varchar column?

    If varchar :

    Select convert(datetime, yourcolumn) as DateCol from dbo.YourTable.

  • RE: SUM

    Try modifing this query as it seems to do the trick from what I see... but I still think that there's a missing column here, but I don't know your...

  • RE: Avg for 5 days

    This can clear up the /5 thing :

    Select distinct number, number/5 as num1, (number - 1)/5 as num2 from master.dbo.spt_values where number between 0 and 999 order by number

    As...

  • RE: Query Analyzer displaying all int datatypes as decimals....

    Nice little option there... I see how this could be usefull when doing a presentation on a big screen. But I still preffer seeing both the queries and the...

  • RE: SUM

    Already asked him 3 times... maybe he'll actually help us help him this time...

  • RE: Sub Select

    You're not bothering anyone... you're not the first one to wonder how to do this... and hopefully it'll help somebody else in the future.

  • RE: SUM

    Again more demo data would have been great because I'm still guessing here :

    this assumes that you have only a single amount column and also assumes that you have...

  • RE: Cross-server query in a stored procedure

    Actually I've always put goes in between the set statements, can you try without 'em and tell me if it works??

  • RE: Cross-server query in a stored procedure

    SET ANSI_NULLS ON

    GO

    SET ANSI_WARNINGS ON

    GO

    Create Procedure MyProc AS

    SELECT * FROM SERVER2.CUSTOMERS.DBO.TABLE1

    GO

Viewing 15 posts - 17,716 through 17,730 (of 18,926 total)