+ Reply to Thread
Results 1 to 4 of 4

SQL Server data and conditional formatting

  1. #1
    Registered User
    Join Date
    09-18-2008
    Location
    Chicago
    Posts
    3

    Question SQL Server data and conditional formatting

    I imported a table from SQL Server 2000 using an ODBC connection and I had 2 columns of dates next to each other. I conditionally formatted one column to use yellow background if the date in the other column was > the date in the current column. It works for some cells and not others. Some where both dates are exactly the same show one is > than the other and sometimes not. Some where one date is null are highlighted and some are not. Some where the date < current shade correctly and some do not. I tried formatting the dates as numbers and they match the dates - in that ones where one date > another the numbers are also > the other, and one date = another the numbers also are equal.
    It's the formatting that seems to be completely random. I also tried copying the data and pasting it in as values and once it worked - when I put the conditional formatting on it worked like it's supposed to and then I tried it again and it went back to random formatting. I gave up at that point.
    I am using Excel 2007 on Windows XP SP2 and SQL Server 2000 Standard SP 4.
    Has anyone else ever run into this?
    Thanks

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    2007 retains previous cf if you redo it it just adds as another conditon
    Select Conditional formatting and Clear Rules from Selected Cells
    failing that post an example in the excell2007 sub forum

  3. #3
    Registered User
    Join Date
    09-18-2008
    Location
    Chicago
    Posts
    3

    Angry SQL Server data and conditional formatting

    I took another shot today and it also does it if I just type in the dates. For example the conditional formatting tells me that "8/10/2003" > "8/11/2003" although I put a formula (=IF(K2 < L2, "Later", "")) next to it that correctly says "Later". On the other hand some of them work - actually the average for the 4 sets of dates that I typed in and conditionally formatted is 75% - it got 3 out of 4 right. My "Later" formula bats 1000.
    I thought it might be regarding the dates I typed in as text - it won't let me format them as dates. However it does sort them correctly - "8/10/2003" < "8/11/2003".
    If I can figure out what a Excel2007 sub forum is I'll post some pictures of this mess.
    Thanks
    I forgot to add that this workbook is a new workbook not converted from v 2003 although it is saved as v 2003.
    Last edited by cduwel; 09-19-2008 at 08:42 AM. Reason: Added something I forgot

  4. #4
    Registered User
    Join Date
    09-18-2008
    Location
    Chicago
    Posts
    3

    Talking Random conditional formatting not so random after all

    Oops!
    It turns out the problem was that when I put in the cell to compare the dates to it defaulted to a fixed reference ($J$2). Changing it to $J2 did the trick. This made the row change but not the column, when I used it earlier it was comparing each date to the value in J2 not the cell next to it. It seems to work in an unintuitive way to me but I don't use Excel that much.
    Thanks for your reply and I hope this helps someone else.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Conditional formatting for data range?
    By Stickshift in forum Excel General
    Replies: 1
    Last Post: 08-24-2008, 06:26 PM
  2. Data Validation lists and conditional formatting again...
    By Timja in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-21-2008, 10:03 AM
  3. Excel 2007 conditional formatting bug
    By jmessina in forum Excel General
    Replies: 0
    Last Post: 04-28-2008, 09:09 AM
  4. Extract Conditional Formatting Data
    By liarliar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2008, 04:15 AM
  5. Applying Conditional Formatting to Data Validation
    By kcstewart in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-28-2007, 06:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1