Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)

  • RE: Query Structure Grouping/Averaging

    r.hensbergen (3/13/2009)


    The way your query is written is possible and works. However, it's not the most versatile. I would suggest to you, you join tables using INNER/OUTER/FULL JOIN. I rewrote...

  • RE: Migrating ISQL batch file into MS SQL SVR 2005 with SQLCMD

    thanks Grant...didn't think it would be that easy...so the BCP commands will work just the same then hey?

  • RE: Help with Formatting a SQL Query

    Jeffrey Williams (7/21/2008)


    The alias t1 was used in the sub-query and I didn't remove it. Modify the sum statements and change the reference from t1 to t and that...

  • RE: Help with Formatting a SQL Query

    Server: Msg 107, Level 16, State 2, Line 1

    The column prefix 't1' does not match with a table name or alias name used in the query.

    Server: Msg 107, Level 16,...

  • RE: Help with Formatting a SQL Query

    Once I have an understanding of the relationships, it really shouldn't be that hard to figure this out.

    Hi Jeffrey - thanks again for your time assisting me with this. I...

  • RE: Help with Formatting a SQL Query

    I am really guessing here - but, I think you want to perform a group by on the whole query.

    select

    g.arrival...

  • RE: Help with Formatting a SQL Query

    As for your problem with multiple rows - that is going to be caused by the joins. In the following:

    from transactions t

    Inner Join rpt_revenue...

  • RE: Help with Formatting a SQL Query

    Jeffrey Williams (7/18/2008)


    Okay, I think this is what you are looking for - but I cannot be sure. I am not sure whether or not you need to tie...

  • RE: Help with Formatting a SQL Query

    GSquared (7/18/2008)


    I'm not clear on exactly what you're trying to do here, but this part definitely won't work:

    sum(select t.tax1_amt as 'IVA' where tran_code='7000'

    Nor the other parts like it. Not...

  • RE: Help with Formatting a SQL Query

    I just noticed I didn't enclose line 11 and 12...but I have more problems than that...:hehe:

  • RE: OSQL Tab Delimited Text File

    thanks, i ended up doing a parameter file and putting in the /n on the last column...

    40 SQLCHAR 0 12 "\r" 40 honor SQL_Latin1_General_CP1_CI_AS

    for some reason...

  • RE: Syntax error converting datetime from character string (stored procedure)

    Amol Mitkari (4/11/2008)


    Hi,

    I thick you cannt add dates using "+".

    CONVERT (datetime,departure,1)+ CAST (out_time as datetime) >=Dateadd(mi,-5,GetDate()))

    Instead of "+" use dateadd function on right hand side also.

    Cheers,

    Amol

    can you post your...

  • RE: Null Value Handling - Stored Procedure

    rbarryyoung (3/24/2008)


    ISNULL does require two arguments and you have 2 ISNULL functions in that statement (only the outer one has the second argument). I suspect that you do not...

  • RE: Null Value Handling - Stored Procedure

    Jason Selburg (3/24/2008)


    You're already doing it in some other cases, like the quest_name line ...

    but anyway ...

    set @phone=ISNULL((select phone from guest where account=@account and room=@room_code group by phone),'')

    could you verify...

  • RE: Null Value Handling - Stored Procedure

    thank you...you're totally right...i did not know that function did that and bc the data in the columns already using that function did not have any "blanks" (nulls) it kind...

Viewing 15 posts - 1 through 15 (of 16 total)