Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
xixo
Starting Member
4 Posts |
Posted - 2008-05-15 : 04:15:58
|
| I have SQL 2005! On one of my tables I have 12594, but at the SQL's bottom bar! It readss 12524! Where are my other 75! The table is linked with an excel that does some calculations! But everything ids faulse sine it doesn't read the right numbner on the rows! For example if I press 12594 as the last is going to give me row 12524 as the last one! PLEASE SOMEBODY HELP |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-05-15 : 04:24:45
|
Please explain your problem in more detail. Do you mean that you get a different result when you do a count(*) or is it the amount of records in Excel that is 12524?If it is in excel, what query are you using to get results in SQL and does the below code (replacing path, filename and worksheet with yours) work?select *FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="<path>\<filename>.xls";Extended properties=Excel 8.0')...[<worksheet>$] a Are you getting rid of null rows? If so and some of the numbers in your worksheet are actually still coming across as text, then SQL will not read these rows, you will need to manually convert these to a number in Excel (by finding them [they have a green triangle in the corner of the cell], clicking in the cell editor at the top of the screen and hitting return works).Oh, and the difference is 70, not 75. |
 |
|
|
xixo
Starting Member
4 Posts |
Posted - 2008-05-15 : 04:47:00
|
| Hello! And thanks for the reply! In one table I have 12594! But the excel reads 12524! THe files are there! BUt the bar on the botto show 12524! If I place a number in the bar in order to find the row is going to give me the wrong row! If I put 10 its going to take me to the 30! WHy? |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-05-15 : 04:56:16
|
| So, where did the data come from, Excel or SQL and how do they match?Please try to explain in more detail what exactly you are trying to do as without a full explanation, you will not get the help you require. |
 |
|
|
xixo
Starting Member
4 Posts |
Posted - 2008-05-15 : 05:03:15
|
| OK! I have a SQl! That has different tables! Each table has data! That 3 - 4 excel sheets are using in order to create some reports (this is not relevant, I think). The data in the tables have been copy and pasted from an excel spread sheet to the sql! I have set as the primary key the first column! Whis contains numbers from 1 - 12549. My problem is that afer (idon't know exactly) number 2000 the sql starts reading different numbers from what the table is diplsaying! When I am looking at the 2001 row the SQL toolbar is saying 1736. I check them and there is nothing missing or the is nothing more of what should be! |
 |
|
|
xixo
Starting Member
4 Posts |
Posted - 2008-05-15 : 05:05:16
|
| And as you understand when the report is trying to pull data from row 2001 it gives me the wrong result! or nothing! So my question is why the SQL doesn't recognise the correct numbers? |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-05-15 : 05:27:35
|
| But which numbers are these? Are these your own numbers? If so, then you will need an ORDER BY on your query. |
 |
|
|
|
|
|
|
|