Solved

ODBC Query to Access Database Won't Filter Correctly

Posted on 2013-06-04
4
736 Views
Last Modified: 2013-06-11
I created an ODBC query into my Access Database. I am using Excel 2003. When i create a query, I have multiple columns. I am trying to filter those columns through Excel to see the data I am looking for. Lets say in Column A are dates. And lets say I have 100 rows of data. Lets say i want to filter those dates Ascending. Also, not all rows have dates. That should be a problem. So, when I sort Column A Ascending, it sorts only 10 rows, then there are 50+ blank cells without dates, but then, there are more dates that didn't filter with the other dates at the top. Why wouldn't all the dates filter together? Why is there a gap in the dates? This data is upated constantly and more rows are being generated daily. So i need this filter to keep in Ascending order and catch the new data being queried. Any thoughts/suggestions??? Thanks!!!!!
0
Comment
Question by:brasiman
  • 2
4 Comments
 
LVL 24

Assisted Solution

by:Steve
Steve earned 200 total points
ID: 39221242
You could sort the data in the SQL using an ORDER BY clause

How have you aquired the data, using MS Query?
If you use Data > From other Sources > MS Query it can be easier to handle the data.
In 2007+ it automatically puts the data into a table which makes life easier, I cannot remember if it does similar for 2003... but it should define the whole area for filtering.

ATB
Steve.
0
 
LVL 16

Accepted Solution

by:
Jerry Paladino earned 300 total points
ID: 39221697
Check the format of the dates that are being returned to Excel from your query.   It is possible that Excel is interpreting some of them as actual dates and others as text strings.  In other words, Excel cannot resolve the date format on some of the records being returned.  

As a test, format the date column as numbers instead of dates.   The ones that are being interpreted as actual dates should be in the 41,400 range of number (01-Jun-2013 = 41,426).   Any date strings that Excel cannot resolve will remain as text strings and not display as numbers.   If this is the case, you will need to restrict how dates are entered into the Access database so a valid date format it used.
0
 

Author Comment

by:brasiman
ID: 39222869
I am running Excel 2003. So I go to Data, Import External Data, New Database Query. The query does not automatically put the data into a table. That is what i think the problem is. How do i get it so the data is automatically put in a table?

I will look at the date formats now.

Any thoughts on how to get the data in a table automatically?
0
 
LVL 16

Expert Comment

by:Jerry Paladino
ID: 39222965
Tables were introduced in Excel 2007.  Excel 2003 (and earlier) has Excel Lists which do not have all the same functionality of the Excel Tables that are in 2007/2010/2013.   The output from the Excel query is creating an Excel list in 2003.   The dates will function the same in an Excel List and in an Excel Table.   No difference.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now