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 bkrike 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: *

  • Users: twifosp
  • Content: Threads
  • Order by date
  1. twifosp

    ORDER BY in Coalesce function

    I've written a function to coalesce mutliple rows into one: ALTER FUNCTION [dbo].[CombineRepNames] ( @CustomerNumber varchar(50) ) RETURNS varchar(1000) AS BEGIN DECLARE @VAR varchar(1000) set @VAR = '' SELECT @VAR = coalesce(@VAR + ' , ','') + name FROM valignmentmaster WHERE...
  2. twifosp

    Extract SQL Code from a broken query

    I have a query that uses a sub query in the select statement. Example: Select * from (select * from tablea union select * from tableb) I know that access will randomly remove your parenthesis in these examples and turn them into brackets. This has apparently happened to me and now I can't...
  3. twifosp

    Running Sum BY Group

    I have some data that looks like: Date GroupA GroupB Units 10/8/2009 ABC AAA 100 10/8/2009 DEF BBB 150 10/8/2009 GHI CCC 90 10/9/2009 ABC AAA 105 10/9/2009 DEF BBB 155 10/9/2009 GHI CCC 95 I want to create a running total by group and by date. So the data would look like this: Date GroupA...
  4. twifosp

    Find a value from a max count in a sub query

    I have some data that looks like this: region_code city zip AAA Houston 77076 AAA Houston 77024 AAB Houston 77024 The region_code is entered manually by a multitude of different people. It should always be the same thing for each city, but some times it gets messed up. I am...
  5. twifosp

    Find Max value of a count

    I have some data that looks like this: region_code city zip AAA Houston 77076 AAA Houston 77024 AAB Houston 77024 The region_code is entered manually by a multitude of different people. It should always be the same thing for each city, but some times it gets messed up. I am...
  6. twifosp

    Database Size

    Is there a way to determine database size in bytes through query analyzer? I need to determine how many gigabytes of data a database I have is, but I do not have dbo rights, so I can not view the size in enterprise manager.
  7. twifosp

    Parsing Text

    I can't get my head around to parse this data. I've got a column that contains dirty regional data stored as text. I want to split it up so I can make it clean. examples: World|USA|New York|New York City|Manhattan|Central Park North World|USA|New York|Hamptons|Bridgehampton...
  8. twifosp

    Calculate row size?

    SHOW TABLE STATUS FROM your_db_name [like 'tabe_name'] Will give me average row sizes, but let's say I needed an exact size for each row. What would be the method to select the size of a specific row?
  9. twifosp

    Excel Dynamic Formula Building

    I have a group of files I want to extract specific cells from and place into a single spreadsheet. For example one of the files name is 20071022.csv. So I can put the following =20071022.csv!$A$3 into a cell and it will give me the value for that cell. The catch is I have a ton of these...
  10. twifosp

    Query Analyzer Colors

    In my query analyzer in sql 2000. For some reason the parsing colors that color code syntax have stopped working. All of my text is just black. Does anyone know the option to reenable this? This happened after I installed an instance of sql server 2005, but I still prefer query analyzer...
  11. twifosp

    Adding timezones to hour fields

    I have a column which gives me the GMT hour that a given activity occured in. so 00 01 02 .. 22 23 I have a timezone that the action occured in so 0 for GMT, -5 for EST ect. I need to create an output that gives the hour of the local hour that the action occured in. Since this GMT hour...
  12. twifosp

    Back up database: Insufficient space

    Someone is trying to transfer a database to me via backing it up and then I am restoring it. I am not the person who performed the back-up. The .bak file is only 58 megs and they say they have truncated all tables ect. When I try and back up the database, I get an error message: Microsoft...
  13. twifosp

    Sub Query Counts Based on Conditions

    Having a hard time getting my head around how to write this query. I have some data that looks like this: inventory_id incident_timestamp abc123 4/26/2006 0:00 abc123 7/7/2006 0:00 abc123 7/8/2006 0:00 abc123 7/19/2006 0:00 abc456 4/24/2006 0:00 abc456 7/1/2006 0:00 abc456 7/9/2006 0:00...
  14. twifosp

    Parsing Text Strings (De-Concatenate?)

    I have some data that I want to group in order to search. An example would look like: (just an exmaple) id Desc 123 Apples oranges bannanas 124 Apples Libraries 125 Bannanas Apples 126 libraries 127 zoos Is there a dynamic way to see how many times the words appear in the table? I could...
  15. twifosp

    I need to concat ntext

    I have a database that will build dynamic web pages using HTML stored in ntext fields. You can have a parent id that corresponds to a full page, and then child id's that actually contain the html and the body of the page. Example: parent_guid child_guid body 1 1a HTML1a 1 1b HTML1b 1...
  16. twifosp

    Charindex Space

    I'm running into a wierd bug that I can't figure out. I have a column that stores email addresses. For whatever reason, the person who designed this application decided to make it store the email address twice in the same column. So the data looks like: email@email.com email@email.com...
  17. twifosp

    Pivot Table: If logic in calculated field

    I have two fields of data that I want to merge based on their dimension. Example: Type Data1 Data2 A 60% 0% B 0% 50% C 90% 0% The way the data is setup, there has to be a second data column for Type B. It's due to different calculations that only apply to B. So I...
  18. twifosp

    Counting based on row condition

    I have a problem I can't seem to get my head around. I have a table that has a column that contains days between issues we log. So it's basically a datediff between the next row. Example: ID Issue Days_btwn_issue 1a 1 1 1a 2 0 1a 3 3 1a 4 4 1a 5 10 1a 6 0 I want to calculate a new issue...
  19. twifosp

    Open rowset syntax help

    Hi, trying to get an open rowset right. I can get it to work if I use a login, but I want to use NT auth. This works: select a.* (from openrowset ('SQLOLEDB',server;'login';'password', 'select * from table') as a This does not: select * from openrowset('SQLOLEDB', 'Trusted_Connection=...
  20. twifosp

    Transferring Data w/ non linked servers

    I have 2 databases existing on 2 seperate servers. We'll call them A and B. I need to get data FROM B, to A, and also base the rows FROM B on criterea from A. In other words, I have a table on A with a list of IDs that I want. So I need the source table from B to talk to this table on A...

Part and Inventory Search

Back
Top