473,320 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Table Update Brings Wrong Number Of Records

24
Hello, I need some help please,
I am trying to insert all the fields from a query to a table. I use the following statement from vba:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [myTBL] select myquery.*  from [myquery];
however myquery depends on other queries which have criteria.
The number of records in [myquery] is 300 but when [mytbl] is loaded it comes up with more records. Any idea why this might be happenning??

thanks a lot..
Oct 4 '07 #1
4 1478
NeoPa
32,556 Expert Mod 16PB
If [MyQuery] is not too complicated post its SQL for us to have a look at. I can't think of a reason for this if all you say is accurate.
Oct 4 '07 #2
TSIGOS1
24
Hi thanks a lot for the reply,
the statements are massive so i trimmed them a bit:)


query ag3:
Expand|Select|Wrap|Line Numbers
  1. SELECT AG.[Portfolio Type], AG.ISIN
  2. WHERE (((AG.[Portfolio Type])=1) AND ((AG.ISIN) Not Like "*PV*")) OR (((AG.ISIN)="SP13"));
query myquery:

Expand|Select|Wrap|Line Numbers
  1. SELECT AG_3.KEYAN7,
  2. FROM AG_LAST3;
and then i call it from excel vba.
What i found out is that the criteria for portfolio type works but not for isin<>PV but only from vba. In access it works fine. how strange is this?
Oct 4 '07 #3
TSIGOS1
24
Apparently I Found The Solution, When There Is A Criteria With A Like * In A Query, Even If Other Queries Are Based On It, If You Run The Subsequent Queries In Excel VBA You Need To Put % Instead.
How Annoying And How Dangerous That Is!
Oct 4 '07 #4
NeoPa
32,556 Expert Mod 16PB
It's a shame you didn't mention you were using it from within Excel before. I could have pointed you in the right direction before now. Never mind.
Check out ANSI Standards in String Comparisons for the full details. Excel is more likely to use the later (ANSI-92) standard but it also has some foibles all of its own.
Oct 4 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: webhigh | last post by:
I¹m not sure if this a PHP question or an MySQL question but here it goes. I have a repeat region of a table called userid What I¹m trying to accomplish is being able to edit the record and...
7
by: Warren Wright | last post by:
Hello, We maintain a 175 million record database table for our customer. This is an extract of some data collected for them by a third party vendor, who sends us regular updates to that data...
33
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
1
by: RC | last post by:
I have an Access 2002 database with many tables and forms (but just to keep things simple, let's say the DB has one Table "Table1" and one Form "Form1"). I have managed to cobble together so much...
7
by: Jake | last post by:
Hi all, I am trying to update an SQL server table from a dataset populated by an excel spread sheet. Each record has a check box so it can be excluded from the SQL server table population. ...
5
by: Louis LeBlanc | last post by:
Hey folks. I'm new to the list, and not quite what you'd call a DB Guru, so please be patient with me. I'm afraid the lead up here is a bit verbose . . . I am working on an application that...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
2
by: Wally | last post by:
Hi there, One table is corrupted. I found compacting is the cause or triggers the process. I have the solution to repair the wrong records but after each compact the same table is corrupted again...
4
by: BulbFresh | last post by:
Hi, I'm using Access 2007. I have imported a table called 'January' and from this I need to update an existing table called 'TablesInfo' which needs to hold some details about the imported...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.