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 jimoo

  1. jimoo

    How execute JS

    Thanks for the response. I am hoping to find lightweight IDE. I have used .NET in the past but don't currently have it installed and would prefer not to unless I have to. I did a google search and found a few but don't know the difference between a good one and a bad one. Temporarily, I have...
  2. jimoo

    How execute JS

    I am have a basic understand of JS and I have worked with VB Script quite a bit so I am familiar with scripting languages. I have decided to explore my knowledge of JS further. Of course, there are lots of examples and articles. The basic question I have is what is the best way for me to...
  3. jimoo

    How to set variable to field in current row

    I found a crude way of assigning the variable to an attribute on the current records, but it's not very clean. It required me to select all the data into a new table (temp) and include a row number using the ROW_NUMBER function. Since my data table is < 500 records and it is already sorted it...
  4. jimoo

    How to set variable to field in current row

    I am trying to set a couple of variables to equal the field values of the current record so I can process that information. I put together sample code that creates a temp table and has 2 attributes (animal & breed) and I would like to set the variables myAnimal and myBreed accordingly based on...
  5. jimoo

    Need to Comma Separate Multiple Fields together

    This is close to what I want but I don't want the leading comma when field01 is empty. I can use another script to update the field from postion 2 on if it begins with a comma. It's just not as elegant. SELECT IIF(field01 = '','','F1-' + field01) + IIF(field02 = '','',',F2-' + field02) +...
  6. jimoo

    Need to Comma Separate Multiple Fields together

    Note: I missed 2 of the insert statements. Here is record 6 and 7. INSERT into aaTemp Values (' ','','','','','') INSERT into aaTemp Values (' ','B','','','','') Jim
  7. jimoo

    Need to Comma Separate Multiple Fields together

    I have data in several fields that need comma separated and combined in one field. I will called the output field MyResults MyReults will begin with F1 for field01, F2 for field02, and so on. The data in MyResults should not begin or end with a comma. Below is code to create the table and...
  8. jimoo

    Unexpected Join Results

    Andrzejek, Unfortunate. That isn't it. This a legacy database imported from AS/400. There are no primary keys or foreign keys per se. The data is linked by fields containing business data. I masked the table an fields since it is company data but the data is linked by a caseid (case...
  9. jimoo

    Unexpected Join Results

    parent table (p) has 569,275 records and child table (c) has 633,283 select count(*) from parent -- 569,275 select count(*) from child -- 633,283 All parents have at least 1 child select p.* FROM [parent] p where p.pID in (select cid from child) -- 569,275 matches parent count Why...
  10. jimoo

    Seek Max record of a Group

    Thanks Andy, I'll give that a try. Here is what I ended up doing. It isn't elegant and took 2 queries and couple of temp tables but it worked: SELECT ParticipantID,MAX(NameEntryID) as PNameEntryID INTO #temp1 FROM NameEntry GROUP BY ParticipantID; select p.ParticipantID, p.NameEntryID...
  11. jimoo

    Seek Max record of a Group

    I am seeking a query that will return the last item (max) based on a set. The personID is the same for several records. I would like the last record for each. For the 1st person (1458748) the nameid I'd like to return is 1405 and the name lastname is Smith. In short, there are 6 sets in...
  12. jimoo

    I am trying to get a list of all

    dhookom - This worked perfectly. Thank you. Jim
  13. jimoo

    I am trying to get a list of all

    I am trying to get a list of all tables and counts for a data conversion project so I can work to eliminate tables with 0 records and identify core child tables. Below is code that I put together that retrieves a unique table names from the database and has a field named cnt (count) for me to...
  14. jimoo

    Export Many SQL Tables to Excel

    I am pulling 20 tables in a spreadsheet. I can do one at a time for a total of 399 files. The number of files per sheet isn't the issue. The issue is the manual process and is there a way to automate this? Jim
  15. jimoo

    Export Many SQL Tables to Excel

    I am using SQL Server 2012 and Excel 2016. I need to export all tables in a database that end with the word "type" to excel. I queried the database and got a list, and I was able t do it using the export tools, but that wasn't efficient. I then did it from excel data tab and selected the tables...

Part and Inventory Search

Back
Top