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 TouchToneTommy 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 manjarikosaraju

  1. manjarikosaraju

    data moving between two databases

    INSERT databaseA.tableUser.tblUser(userid,siteid) SELECT userid, EntityId FROM databaseB.tableUser.tblhelper
  2. manjarikosaraju

    SQL Query to Check partial string value

    select * From table where isnull(col3,' ') not like '%WORKSTATIONS"'
  3. manjarikosaraju

    Importing dates into table

    You need to change the datatype to varchar(10) to get the dates as it is in the excel sheet. Then you need to convert it into datetime format so that it has the right month and day. To create a temp table with the same structure as original table do the following: 1. In SQL query analyser...
  4. manjarikosaraju

    How to do a Select statement to get this..

    select day(datecolumn) as day, cast(min(ticketno) as varchar(5)) + ' (to) ' + cast(max(ticketno) as varchar(5)) as ticketnumber, sum(Amount) as TotalAmount from Table where month(datecolumn) = 8 /*for august*/ group by day(datecolumn) order by day(datecolumn) -Manjari
  5. manjarikosaraju

    Importing dates into table

    Hi EO, Create a temporary table with exactly the same datatype for all other columns in the original table excpet for date coulmn. For date column change the datatype to varchar(10). Then import the spreadsheet saved under US format into this temporary table. Then copy the records from...
  6. manjarikosaraju

    help with SQL query

    select cast[Weight] as varchar(10)) + '/' + cast(Convert (decimal(10,2), round([Weight]/2.2, 2)) as varchar(10)) from qryHeightWeight2
  7. manjarikosaraju

    select only value?

    select pid, type, dateP from #tab1 a where not exists (select pid from #tab1 b where type = 'MK' and a.pid = b.pid)
  8. manjarikosaraju

    The most children

    I am not very familiar with SQL Server 6.5 syntax Try this: Declare @MaxCnt int select @MaxCnt = max(x.Cnt) from (select membership_no, count(distinct role_no) as Cnt from #Role group by membership_no) x select A.membership_no, A.First_Name, A.SurName, @MaxCnt as RoleCnt from #Member A join...
  9. manjarikosaraju

    The most children

    select A.membership_no, A.First_Name, A.SurName, B.Cnt as RoleCnt from #Member A join ( select top 1 membership_no,count(distinct role_no) as Cnt from #Role group by membership_no order by Cnt desc ) B on A.membership_no = B.membership_no -Manjari
  10. manjarikosaraju

    Help with query please

    select * from BOLS a where not exists (select distinct b.BOLNUM, b.ORDERNUM,b.INVNUM from BOLS b join BOLINOB c on b.BOLNUM = c.BOLNUM and b.ORDERNUM = c.ORDERNUM and b.INVNUM = c.INVNUM and b.BOLNUM = a.BOLNUM and b.ORDERNUM = a.ORDERNUM and b.INVNUM = a.INVNUM) -Manjari
  11. manjarikosaraju

    Stored Proc not updating multiple rows

    Is it possible that the table tbl_JobItems is present under two different users in the same database? (i.e., one with your login.Table and ApplicationLogin.Table)??
  12. manjarikosaraju

    ADDING DATES

    Try this, Its not clear from your query if year will be same always. If it is same, then just take the difference of month values. Else convert day,month,year into a datetime and get the difference of min, max dates grouped by posgid, upby. For the user Gerar, if you want 0 months as result...
  13. manjarikosaraju

    SQL select statement help; conditional sum

    select sum(case when amtType = 'CR' then Amt when amtType = 'DR' then -1*Amt end), ActID from #Amts group by ActID
  14. manjarikosaraju

    Alter Column(s)?

    OOPS!!! I read it as add columns instead of alter columns. Just ignore the previous post. -Manjari
  15. manjarikosaraju

    Alter Column(s)?

    Seperate each new column by a comma.. ALTER TABLE <TABLENAME> ADD <columnname> <datatype>, <columnname> <datatype>, <columnname> <datatype>

Part and Inventory Search

Back
Top