Solved

ODBC Query to Access Database Won't Filter Correctly

Posted on 2013-06-04
4
721 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

759 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

23 Experts available now in Live!

Get 1:1 Help Now