I want to run a update query - accApp.OpenCurrentDatabase sRawDatabaseName
-
accApp.DoCmd.TransferText acImportDelim, "DataImportSpec", "tblRaw", sLocalDataFile, False
-
accApp.DoCmd.RunSQL "Update tblRaw SET tblData.MaturityDate="" WHERE BookCode="123-America" AND StrategyID IN('420','320','220');"
This sRawDatabaseName is C:\Documents and Settings\All Users\Documents\Data.mdb
Access doesn't accept this SQL - "Update tblRaw SET tblData.MaturityDate="" WHERE BookCode="123-America" AND StrategyID IN('420','320','220');"
Whereas I run it , by saving the intermediate database and it works fine .I run in that database manually - Update tblData SET MaturityDate="" WHERE BookCode="123-America" AND StrategyID IN('420','320','220');
Please help immediately if possible.Many thanks in advance !!
First off, for the sake of clarity, don't be afraid to use the [code] boxes in this forum.
Onto your issue. Your SQL is in the form of a string. What this means is that Access chokes when you use quotes in the way you did: - "Update tblRaw SET tblData.MaturityDate="" WHERE BookCode="123-America" AND StrategyID IN('420','320','220');"
It currently sees it as three separate strings: - Update tblRaw SET tblData.MaturityDate=" WHERE BookCode=
-
123-America
-
AND StrategyID IN('420','320','220');
The above doesn't even have any sort of concatenation symbol ( & ) so Access panics and doesn't know what to do. If you change it to this, it may solve your issue: - "Update tblRaw SET tblData.MaturityDate='' WHERE BookCode='123-America' AND StrategyID IN('420','320','220');"
EDIT: Nice link, NeoPa! I didn't know it existed, but c'est tres utile!
5 1395
First off, for the sake of clarity, don't be afraid to use the [code] boxes in this forum.
Onto your issue. Your SQL is in the form of a string. What this means is that Access chokes when you use quotes in the way you did: - "Update tblRaw SET tblData.MaturityDate="" WHERE BookCode="123-America" AND StrategyID IN('420','320','220');"
It currently sees it as three separate strings: - Update tblRaw SET tblData.MaturityDate=" WHERE BookCode=
-
123-America
-
AND StrategyID IN('420','320','220');
The above doesn't even have any sort of concatenation symbol ( & ) so Access panics and doesn't know what to do. If you change it to this, it may solve your issue: - "Update tblRaw SET tblData.MaturityDate='' WHERE BookCode='123-America' AND StrategyID IN('420','320','220');"
EDIT: Nice link, NeoPa! I didn't know it existed, but c'est tres utile!
NeoPa 32,556
Expert Mod 16PB
Thanks LePhantasmSeul :)
We have a bunch of articles on the site in Access. I try to link to them where I can. It saves reinventing the wheel every time, which can get a little tedious.
PS. I just got back from Paris at the weekend so my French is as good as it gets ATM :D
Thanks All ...for your responses and explanations....Yes, the last update query in the link , worked fine.
NeoPa 32,556
Expert Mod 16PB
Thanks for the response Titli. Glad that helped.
I'm going to set post #3 as best as the explanation there is the clearest and fullest.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Art |
last post by:
Hi,
Can anyone point me to an example of how I would execute a query I've created in an Access DB. I've copied the SQL down to my VB.net application and that works fine, but it's ugly. I'd like...
|
by: s_wadhwa |
last post by:
SELECT DISTINCTROW "01C" AS dummy, Buildings.BuildingNumber,
UCASE(Buildings.BuildingName) AS BuildingName,
Buildings.MasterPlanCode, Buildings.UniformBuildingCode,...
|
by: ShastriX |
last post by:
Getting a weird error while trying out a query from Access 2003 on a
SQL Server 2005 table.
Want to compute the amount of leave taken by an emp during the year.
Since an emp might be off for...
|
by: zwasdl |
last post by:
Hi,
I'm using MS Access to query against Oracle DB via ODBC. Is it
possible to use HINT in Access?
Thanks,
Wei
|
by: k-man |
last post by:
Hi:
I have an MS Access query for a table called MyTable. One of my
fields in the query is a custom field that looks like "MyField: =
MyFunction(ID)" where ID is a field in MyTable.
I have...
|
by: pkerr2003 |
last post by:
I want to list all groups within my data regardless of whether they meet a certain condition - if they do not meet the condition I want to display a count of 0 for the relevant groups.
Access...
|
by: jsacrey |
last post by:
Hey everybody, got a secnario for ya that I need a bit of help with.
Access 97 using linked tables from an SQL Server 2000 machine.
I've created a simple query using two tables joined by one...
|
by: markvolz |
last post by:
Hi,
I have an access query. Currently it runs fine except now I would like it to run silently. I set task scheduler to run it as needed. However, I need to have it run silently without having...
|
by: OzNet |
last post by:
I have a query (with calculated fields) in Access (2007) and the data changes depending on the dates and staff person selected. I need to produce a series of graphs based on the data in this query...
|
by: uno7031 |
last post by:
Help Please!!! Adding 5 Days to another Date in an access query
Good Morning,
Help please…. I am new to access and trying to write a query that will add 5 days between a RecDate and a...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |