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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  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>
  16. manjarikosaraju

    ints to date

    SELECT convert(datetime,cast(month as varchar(2)) + '-' + cast(day as varchar(2)) + '-' + cast(year as varchar(4)),101) FROM TABLE
  17. manjarikosaraju

    COUNT WITH A GROUP BY

    SELECT State, PType, count(*) as Cnt INTO #Temp FROM TABLE1 --(TABLE1 contains ProjectId,ProjectName,Projecttype and State details) GROUP BY State, PType order by State, PType --select * from #Temp SELECT State, SUM(CASE PType WHEN 'BedRoom' THEN Cnt ELSE 0 END) AS BedRoom, SUM(CASE PType...
  18. manjarikosaraju

    query-problem

    TRY THIS...The column names and table names in the below query might not match exactly with yours... select A.TeamId, A.Name1, A.FirstName1, A.Name2, A.FirstName2, A.Discipline, A.number from ( select tp1.teamId, p.PersonId, p.LName as Name1 , p.FName as FirstName1, p2.LName as Name2, p2.FName...
  19. manjarikosaraju

    Error when running DTS package re: NULL values

    It might be possible that the file you are trying to import into SQL has some extra rows at the end which is causing the NULL value insert. Try deleting those extra rows from the file and run the DTS package again. OR Remove do not allow null values constraint on the columns of the table you...
  20. manjarikosaraju

    Return string from SQL

    Try this.. for the variable @pmAction you need to specify the length of the varchar datatype unless it is single letter. You need to cast datetime,integer data types to varchar when storing a result in a string data type. Hope this helps. ------------------------------------------------ CREATE...

Part and Inventory Search

Back
Top