Forum Replies Created

Viewing 15 posts - 1,021 through 1,035 (of 1,082 total)

  • RE: Min() Max() and joining fields

    mmm ok he he he

    I normally find this to be messy trying to do it one query.

    So what I do is get the values into a Table Variable or temp...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Min() Max() and joining fields

    try this.

     

    I may have made some syntax mistakes but I am sure you will get the jist

    SELECT

    MINER2BIDPRICE

    ,

    MAXER2BIDPRICE

    ,

    MAXESBIDPRICE

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: need a query

    There is another option.

    You could the objectID's for the tables and build a dynamic query which would only require you to type one select and then print or execute the...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: need a query

    Hi there,

     

    Do you want to find all the records that say have emp_ID = 100

    You could use a UNION

    You could use temp/table table variables

     

    Does this help?

     

    Thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to show row values in columns wise.

    HI there,

     

    What version of SQL you using?

     

    If you using 2005 you could use the pivot functionality if you using 2000 you could use case statements

     

    thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: trigger help

    HI guys,

     

    I have created a proc that tries to create all triggers for insert/update and delete auditing

    http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1950

     

    see if this helps

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Complex (to me) SQL Query statement help

    Have you tried this.

     

    select distinct dbo.tbl3215.ittnumber, dbo.tbl3215.itttitle, dbo.tbl3215.daterequired from dbo.tblassignment inner join dbo.tbl3215 on dbo.tbl3215.ittnumber = dbo.tblassignment.ittnumber inner join dbo.tblfltwrkcntr on dbo.tblfltwrkcntr.fltwkcntrid = dbo.tblassignment.assfltwrkid where ((itttitle is not null or...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query Truncated

    Hi again 🙂

     

    Would it be possible for you to post the code?

     

    Thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query Truncated

    Hi Lim,

     

    I'm pretty sure that when you are using dynamic SQL you are restricted to a varchar variable of 4000 chars.

     

    Try breaking you query up into smaller parts and executing...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: how to loop through all tables/columns to search for phrase

    Hi Steven,

     

    Not sure if this is teh most process affective way of doing it but it's a good starting block I think:

     

     

    CREATE TABLE ##VtblTables

          (

         ...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Exporting Data for reporting purposes (Help Required).

    HI There,

     

    Are you reports run at the sametime everyday?

    Do you need realtime data?

     

    Thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Combining two varchar fields to one datetime

    HI Tom,

     

    Sorry for the delay.

     

    Could you try replacing the highlighted section with the following.

    cast(stuff(stuff(Date_Created,5

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Combining two varchar fields to one datetime

    HI Tom,

     

    I am confused.

    This orginal line  code is not in the last section of code you sent me...

     

    Thanks

    chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Combining two varchar fields to one datetime

    Hi Tom,

     

    Great to hear you loving it 🙂

     

    Are you sure the error is at this point in your code?

    Perhaps you could send me some more code to read through

     

    thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Combining two varchar fields to one datetime

    HI Tom,

     

    I used this code here and everything works fine.

    Please could you try it yourself.

     

    CREATE

    TABLE Temp

    (

    Date_Created

    VARCHAR

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

Viewing 15 posts - 1,021 through 1,035 (of 1,082 total)