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!

Search results for query: *

  1. glenntb

    Teradata SQL Assistant query - Condition in WHERE statement

    I'm not certain, but I think this will do what you're looking for: SELECT [field1], [field2], [field3] FROM tblABC WHERE ( conditionA AND something = something ) OR ( conditionB AND something <> something ) Glenn
  2. glenntb

    Order By Statement, please help

    It appears that you've got two ELSE conditions tied to the first CASE statement. I copied your code into a text editor, and played with the line breaks to line up all the CASE WHEN and ELSE statements. Here's a pseudo-code picture of what your code looks like when you do this: 01 ORDER BY...
  3. glenntb

    Group Rows into One Row With Multiple Columns

    First, a disclaimer that I'm a little new to SQL and still learning... but I think this might work for you: SELECT Group_Name, ScheduledYear, CASE WHEN SUM(CASE WHEN Q1 = 'Null' THEN 0 ELSE 1 END) > 0 THEN 'Audit Info' ELSE 'Null' END AS Q1, CASE WHEN SUM(CASE WHEN Q2 = 'Null'...
  4. glenntb

    Run VBA Module from different workstations from Excel Menu

    Instead of using "thisworkbook" use "activeworkbook" -Glenn
  5. glenntb

    Excel VBA adds quotes on output to notepad

    Does the problematic text string contain a delimeter within it? (e.g. is there a comma in the string: "Doe, Jane") Glenn
  6. glenntb

    Duplicate color change

    If you want to highlight the pairs of duplicates, you'll need to modify the above code to something along these lines: Sub Highlight_Duplicates(Values As Range) Static blnColor As Boolean ' ' Make sure there's no highlighting already in our range: Values.Interior.ColorIndex =...
  7. glenntb

    How can I delete all the MergeCells

    I'm with Skip... Deleting rows containing merged cells will lead to the loss of any other data on that row. It would be safer to unmerge the merged cells, then delete the empty rows, leaving the un-empty rows in your data set for processing. If you are absolutely certain that this will never...
  8. glenntb

    Conditional Formatting for more than 3 using referenced cells

    Will this work for you? Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer For Each mycell In Array([K1], [E2], [H2], [K2]) Select Case mycell.Value Case "" icolor = 16 Case Is < 0.505 icolor =...
  9. glenntb

    CANADA VICTORIA DAY

    PHV: Nice! It actually lends itself to a non-VBA answer as well Year Formula Result 2010 =DATE(D3,5,24)-WEEKDAY(DATE(D3,5,24))+1 5/23/2010 2011 =DATE(D4,5,24)-WEEKDAY(DATE(D4,5,24))+1 5/22/2011 2012 =DATE(D3,5,24)-WEEKDAY(DATE(D3,5,24))+1 5/20/2012
  10. glenntb

    CANADA VICTORIA DAY

    This should work: Function VictoriaDay(iYear As Integer) As Date ' ' Calculates the first Monday before 5/25 of the provided year Dim dtTest As Date dtTest = CDate("5/24/" & iYear) While Weekday(dtTest) <> 2 ' note: 2 = Monday dtTest = dtTest - 1 Wend...
  11. glenntb

    Programatically accessing pivot table cache

    This looks like it'll do what I'm looking for, but I get an error on the first line. I also had to rewrite the loop so that Excel VBA was happy: Set rst = ActiveSheet.PivotTables(1).PivotCache.Recordset Do Until rst.EOF For Each fld In rst.fields MsgBox fld.Value Next rst.movenext...
  12. glenntb

    Programatically accessing pivot table cache

    Thanks Skip... I've been playing with them all day and can't seem to make anything work. Has anyone ever successfully used the methods and properties on a PivotCache Object that might be able to give me some pointers? The help files are proving to be something less than helpful. Glenn
  13. glenntb

    Programatically accessing pivot table cache

    Greetings! I have an Excel Pivot Table pulling data from an Access db. The source data is >65K lines (it's actually close to 200K). The original Access data is no longer available, but the Pivot table still works because the original data is stored somewhere in Excel (in a Pivot cache...
  14. glenntb

    Opps! Sorry, I misunderstood.

    Our pastor frequently changes the message board in front of our church. One Sunday, he posted "Every Believer Has A Message". As I was pulling into the parking lot, I only glanced at it and could have sworn it said "Every Beaver Has A Message". Of course, I had to mention that to him, and he...
  15. glenntb

    Primary Key is being lost

    Thanks Michael - I am not having a problem with autonumber, though. My unique key identifier already exists in the file extracts that I import fresh each day to ensure that I have the latest data. The issue that I am having is that the table that I am loading the data into, forgets that the...
  16. glenntb

    Primary Key is being lost

    I haven't tried that - I will give that a try the next time I lose the key designation (it seems to happen 2-3 times /year). Actually, is there a way to trigger a Compact & Repair via code? If so, I could schedule it to run once/month to try and prevent future problems. I haven't been able...
  17. glenntb

    Primary Key is being lost

    The database option "Compact on close" is checked, so that the db gets compacted daily. I have seen occasional errors where compacting is not successful, do you think this is where the key is getting lost? Thanks! Glenn
  18. glenntb

    Primary Key is being lost

    I have an Access table with "AccountNum" defined as a Primary Key (Indexed = Yes(No Duplicates)). Each day, I delete all records from this table, then recreate the list using a series of append queries. This process has worked well for a number of months. All of a sudden, I notice that my...
  19. glenntb

    Custom MS Excel xla add-in - Re-Start Issue

    If your form loads automatically when the Add-in is installed, something like this might work: Sub RestoreForm() AddIns("your add-in name here").Installed = False AddIns("your add-in name here").Installed = True End Sub -Glenn
  20. glenntb

    great quotes heard around the world...tell me what you've heard!

    I have "collected" quotes for a long time now. Here are some of my favorites: ... and my (so far) all time favorites: Enjoy! Glenn

Part and Inventory Search

Back
Top