Forum Replies Created

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

  • 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

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

    what's the tabbed mode?? I've already seen the wave option but I never used it.

  • RE: Avg for 5 days

    Quick math from sql server :

    0 / 5 = 0

    1 / 5 = 0

    2 / 5 = 0

    3 / 5 = 0

    4 / 5 = 0

    Select avg(temp) as AvgTemp,...

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

    Maybe you were sleepwalking or sleeptyping... I doubt that this could be set using a tsql command so I must assume it was done by hand... Can't tell who...

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