Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by tran008

  1. tran008

    trying to understand the code...

    Thank you very much...
  2. tran008

    trying to understand the code...

    Hi all, I'm trying to understand the code below, with (+). Comming from MS-SQL server, I never seem this before. Can some explain what the (+) does? thanks SELECT tblA.FIRST_NAME, tblA.lAST_NAME, tblA.STREET_NUMBER, btlA.CITY FROM tblA, tblB WHERE...
  3. tran008

    conditional join (I think) in SQL

    Not sure about the condition join, but I would do a union select field1, field2, field3 from OOMM inner join SER on comm.userid=ser.userid where comm.type='SER' union all select field1, field2, field3 from OOMM inner join EMP on comm.userid=emp.userid where comm.type='EMP'
  4. tran008

    Pseudonymisation function

    George, Any change this could product a duplicated? :)
  5. tran008

    .ldf file grown to fill disk

    Put the Recovery Model to simple instead of Full.
  6. tran008

    report of current users login AD

    Hi all, I need to generate a report to show all current user(s) login the Active Directory. Anyone have the script, or point me to the right direction? This is a Windows 2003 Domain server. thanks
  7. tran008

    Convert varchar to date field

    Look up convert or cast from BOL: eg select convert(varchar, DateOfReferral,120)
  8. tran008

    Return Multiple rows in single row

    select patID, txtCode into #table1 from ( select 547385 as patID, '001' as txtCode union all select 547385 , '002' union all select 547385 , '01B' union all select 547385 , '026' union all select 1094870 , '001' union all select 1094870 , '002' union all select...
  9. tran008

    Query Help - Subquery/Exsists/?

    SELECT O.FILEID, O.OFFICE, I.INVOICEID, (CASE WHEN I.STATUS = 'closed' THEN 'Invoie Finalized' ELSE 'Invoice Not Finalized' END) INVOICESTATUS FROM ORDERS O LEFT JOIN INVOICE I ON O.FIELID = I.FILEID WHERE O.STATUS = 'closed'...
  10. tran008

    query result for Profit/loss analysis

    Base on the code below, this is how I came up with the result, however this involve with temp table...which taking a bit to return the resolved. Anyone have any other suggestions on how to do this. thanks --table UTIL_NUMS is a number base from 1 to 5,000,000 select 1 id,150000 as qty_in...
  11. tran008

    query result for Profit/loss analysis

    I have the following in the table: id QTY_IN Price_IN QTY_Out Price_out 1 150000 10.01 150000 10.01 2 15 10 5 15 3 25 12 35 18 4 25 20 35 25 5 45...
  12. tran008

    sort order query

    SQL2005: declare @tbl1 table(ID int, CatID int, SubCatID int, Description varchar(35)) insert into @tbl1(id, catid,subcatid, description) select 7, 7 , 0, 'Sprinklers' union all select 8, 8 , 0 , 'Intruder Alarm' union all select 9 , 9 , 0...
  13. tran008

    Turn 2 Rows into 1

    search for Pivot or have a look at this thread http://www.tek-tips.com/viewthread.cfm?qid=1479412&page=6
  14. tran008

    Stored proc with params to select a specific database?

    Select Name From master.dbo.SysDatabases
  15. tran008

    Count by Month

    something like this? select dateadd(month,datediff(month,0,datefield),0) as [month], count(groupmember) as [Auth Count] from table group by groupmember, dateadd(month,datediff(month,0,datefield),0) order by dateadd(month,datediff(month,0,datefield),0)

Part and Inventory Search

Back
Top