Convert Access SQL to SQL

Hi All,

I wrote this query (in access03) and then went to sql view and tried
top copy and paste it into a button's on click event

DoCmd.RunSQL "UPDATE tblAnimalBleedsStatus INNER JOIN
tblCatalogPartNumbers ON tblAnimalBleedsStatus.CatalogNumber =
tblCatalogPartNumbers.CatalogNumber SET
tblAnimalBleedsStatus.FinalLotsWB = [tblCatalogPartNumbers]![WB]WHERE
(((tblAnimalBleedsStatus.FinalLotsWB) Not Like '11*' And
(tblAnimalBleedsStatus.FinalLotsWB) Not Like 'R&D' And
(tblAnimalBleedsStatus.FinalLotsWB) Not Like '44*'));"


I had to modify it by changing the NOT LIKE values into single
quotation marks and obviously I added the DoCMD.RUNSQL command. When I
run it I see a qucik blip on the staus bar like it ran the query but
in tblAnimalBleedsStatus the fields are all still NULL.

Any ideas what I am doing wrong?

THanks in advance

0
Richnep
10/23/2007 11:38:05 PM
access.forms 6864 articles. 2 followers. Follow

3 Replies
654 Views

Similar Articles

[PageSpeed] 35

Richnep <Richnep@gmail.com> wrote in
news:1193173838.752279.67550@z24g2000prh.googlegroups.com: 

> Hi All,
> 
> I wrote this query (in access03) and then went to sql view and
> tried top copy and paste it into a button's on click event
> 
> DoCmd.RunSQL "UPDATE tblAnimalBleedsStatus INNER JOIN
> tblCatalogPartNumbers ON tblAnimalBleedsStatus.CatalogNumber =
> tblCatalogPartNumbers.CatalogNumber SET
> tblAnimalBleedsStatus.FinalLotsWB =
> [tblCatalogPartNumbers]![WB]WHERE 
> (((tblAnimalBleedsStatus.FinalLotsWB) Not Like '11*' And 
> (tblAnimalBleedsStatus.FinalLotsWB) Not Like 'R&D' And 
> (tblAnimalBleedsStatus.FinalLotsWB) Not Like '44*'));" 
> 
> 
> I had to modify it by changing the NOT LIKE values into single
> quotation marks and obviously I added the DoCMD.RUNSQL command.
> When I run it I see a qucik blip on the staus bar like it ran the
> query but in tblAnimalBleedsStatus the fields are all still NULL.
> 
> Any ideas what I am doing wrong?
> 
> THanks in advance
> 

[tblCatalogPartNumbers]![WB]WHERE
needs to be
[tblCatalogPartNumbers]![WB] WHERE

-- 
Bob Quintal

PA is y I've altered my email address.

-- 
Posted via a free Usenet account from http://www.teranews.com

0
Bob
10/23/2007 11:25:57 PM
Not the cause of your problem but, don't use RunSQL.

Try this:

Dim strSQL As String

strSQL = "UPDATE tblAnimalBleedsStatus INNER JOIN tblCatalogPartNumbers " & _
"ON tblAnimalBleedsStatus.CatalogNumber = 
tblCatalogPartNumbers.CatalogNumber " & _
"SET tblAnimalBleedsStatus.FinalLotsWB = [tblCatalogPartNumbers]![WB] " & _
"WHERE tblAnimalBleedsStatus.FinalLotsWB Not Like '11*' " & _
"And tblAnimalBleedsStatus.FinalLotsWB Not Like 'R&D' " & _
"And tblAnimalBleedsStatus.FinalLotsWB Not Like '44*';"

CurrentDb.Execute strSQL, dbFailOnError

Steve

"Richnep" wrote:

> Hi All,
> 
> I wrote this query (in access03) and then went to sql view and tried
> top copy and paste it into a button's on click event
> 
> DoCmd.RunSQL "UPDATE tblAnimalBleedsStatus INNER JOIN
> tblCatalogPartNumbers ON tblAnimalBleedsStatus.CatalogNumber =
> tblCatalogPartNumbers.CatalogNumber SET
> tblAnimalBleedsStatus.FinalLotsWB = [tblCatalogPartNumbers]![WB]WHERE
> (((tblAnimalBleedsStatus.FinalLotsWB) Not Like '11*' And
> (tblAnimalBleedsStatus.FinalLotsWB) Not Like 'R&D' And
> (tblAnimalBleedsStatus.FinalLotsWB) Not Like '44*'));"
> 
> 
> I had to modify it by changing the NOT LIKE values into single
> quotation marks and obviously I added the DoCMD.RUNSQL command. When I
> run it I see a qucik blip on the staus bar like it ran the query but
> in tblAnimalBleedsStatus the fields are all still NULL.
> 
> Any ideas what I am doing wrong?
> 
> THanks in advance
> 
> 
0
Utf
10/23/2007 11:54:01 PM
On 23 Oct 2007 23:25:57 GMT, Bob Quintal <rquintal@sPAmpatico.ca> wrote:

>Richnep <Richnep@gmail.com> wrote in
>news:1193173838.752279.67550@z24g2000prh.googlegroups.com: 
>
>> Hi All,
>> 
>> I wrote this query (in access03) and then went to sql view and
>> tried top copy and paste it into a button's on click event
>> 
>> DoCmd.RunSQL "UPDATE tblAnimalBleedsStatus INNER JOIN
>> tblCatalogPartNumbers ON tblAnimalBleedsStatus.CatalogNumber =
>> tblCatalogPartNumbers.CatalogNumber SET
>> tblAnimalBleedsStatus.FinalLotsWB =
>> [tblCatalogPartNumbers]![WB]WHERE 
>> (((tblAnimalBleedsStatus.FinalLotsWB) Not Like '11*' And 
>> (tblAnimalBleedsStatus.FinalLotsWB) Not Like 'R&D' And 
>> (tblAnimalBleedsStatus.FinalLotsWB) Not Like '44*'));" 
>> 
>> 
>> I had to modify it by changing the NOT LIKE values into single
>> quotation marks and obviously I added the DoCMD.RUNSQL command.
>> When I run it I see a qucik blip on the staus bar like it ran the
>> query but in tblAnimalBleedsStatus the fields are all still NULL.
>> 
>> Any ideas what I am doing wrong?
>> 
>> THanks in advance
>> 
>
>[tblCatalogPartNumbers]![WB]WHERE
>needs to be
>[tblCatalogPartNumbers]![WB] WHERE

or maybe even better,

[tblCatalogPartNumbers].[WB] WHERE

! is a delimiter for Object references such as forms; . is the proper SQL
syntax for table.field.

             John W. Vinson [MVP]
0
John
10/24/2007 1:53:37 AM
Reply:

Similar Artilces:

How to Convert UTC to localTIme(C# )
I have got the value of user account's lastlogon time. Its type is Int64. This value is stored as a large integer that represents the number of 100 nanosecond intervals since January 1, 1601 (UTC)(Refer to MSDN). I don't know how to convert this value to localTime. The following is my code. ################################################################ DirectoryEntry deUser = new DirectoryEntry(ldappath); DirectorySearcher src = new DirectorySearcher(deUser); src.Filter = "(&(objectClass=user)(SAMAccountName=" + accountNa...

Convert text to time value
I have a series of time values in a 'General' format. They are of the type: 184525 Which is 18:45:25 or 6:45:25 pm. A time which is am would be of the type: 12345 Which is 1:23:45 am. Is there a way to convert those 'General' values to an Excel serial so that I can figure out the difference between two times? I've seen a bunch of examples on the net, but none of those that I have found deal with this format that I can tell. Thanks. Hi try =--TEXT(A1,"00:00:00") -- Regards Frank Kabel Frankfurt, Germany "Andy" <amelton@gmail.com> schrieb...

how to convert date
Hi, I'm looking for some method to convert mail date, in format: eg. "Sun, 18 Sep 2005 20:57:08 +0200", to computer local time. I tried CTime but without resoults. m. Have you tried COleDateTime::ParseDateTime()? m.wski21.usunto@aust.com wrote: > Hi, > > I'm looking for some method to convert mail date, in format: > eg. "Sun, 18 Sep 2005 20:57:08 +0200", to computer local time. > I tried CTime but without resoults. > > m. >I'm looking for some method to convert mail date, in format: >eg. "Sun, 18 Sep 2005 20:57:08 +0200&qu...

How do I convert dates to text keeping the format?
I'm trying to convert a column of data in date format *m/d/yyyy to a text format without converting to serial numbers. Ie: I want to retain the mm/dd/yyyy format. Is there a way to do this? =TEXT(A1,"MM/DD"/YYYY") "sprlarry" <sprlarry@discussions.microsoft.com> wrote in message news:69669AA6-FD15-47D7-843D-FC768728BF7A@microsoft.com... > I'm trying to convert a column of data in date format *m/d/yyyy to a text > format without converting to serial numbers. Ie: I want to retain the > mm/dd/yyyy format. Is there a way to do this? That ...

Outlook 2007 Voice Access
Hello, Exchange 2007 SP1, Outlook 2007 SP2. We disabled the functionnality of Outlook Voice Access (OVA) to play e- mail messages on the phone - and limited it only to listen to voice messages. But we just noticed that when you disable this e-mail reading feature, OVA does not tell you how many NEW voice messages you have in your mailbox (they have not been read in Outlook and are still marked as unread). You can however continue and listen to them. So for me the TUIAccessToEmailEnabled PowerShell command set to $false also prevents knowing how many NEW voice messages we have...

Excel: Auto converting text to numbers
I am downloading an Excel sheet, and the numbers come in as text. It basically comes in as "33 %" but Excel registers this as text, not a percentage. I have a cell that will be used to add the numbers, but since they are text it doesn't work. Given this information, is there a way to convert the imported data into numbers. I would prefer to include this into my formula. The potential numbers are: 0, 1, 2, 3, 4, 0 %, 25 %, 33 %, 50 %, 67 %, 75 %, 100 %, and N/A I would prefer a function, again if possible, that could convert any number. Please note, the space between the nu...

Help with programming Access 2003
I am doing a database of my families movie collection and I would like to have a feature like an autonumber for sorting the movies in their cases. I have the movies broken up into A(dult) and K(id) I would like to have the autonumber have either the a for adult or k for kid then the number. However I have no idea on how to achieve this....Any assistance would be greatly appreciated and thank you in advance for your help On Dec 18, 7:22 pm, samurai71 <samura...@gmail.com> wrote: > I am doing a database of my families movie collection and I would like > to have a feature like an a...

Unable to access my new mails
Hi, I have been using OUTLOOK since 5 months and never had a problem, but since last week, I m unable to watch new emails. When I click send/recieve button, it shows there are lot of messages are scanning, but when its dont there is nothing in my inbox. So I think server is receiving my mails but unable to present those on screen. Please help me out, since its the only way to be in touch with my world. Give me a suggestion abt this matter. ...

CRM1.2 on SQL 2005
Does CRM 1.2 support SQL Server 2005 standard edition? I am trying to install and get the following error: I'm trying to install Microsoft CRM server 1.2 on Server2003 with SQL 2005 and get following installation error during install: "Setup was unable ot install Microsoft CRM Server. Setup was unable to create the Microsoft CRM databases. Failed to run script:00 - create mscrm.sql. HRESULT:80040E14. Unknown error. (80040E14)." Thanks Chris "Chris" <chrisd1972@gmail.com> wrote in news:1153695510.955617.243440 @p79g2000cwp.googlegroups.com: > Does CRM 1....

how to convert excel's .cvf file to .csv file
...

Convert Access97 to 2000
Hello, we're currently running access97 and would like to convert it to 2000, but we don't know what is the administrator password for this database. Also this database is running on multi user and have difference permission for diffence users. Could someone help me how to do make this happen but keep the currently permission retaint. Thanks ...

MDE in Access 2003
My office is the process of upgrading all users to Office 2003 from Office XP. I've encountered a problem that when I've edited a database created with Access 2002, and create an MDE file, those users still in Office XP cannot open the MDE file. They receive an error that says something like "file is incorrect format." (And I have to edit all existing databases...Access 2003 shows a missing reference to web components that impedes the database from executing formulas and it gives an error message. In order to check-off the missing reference, I have to open the data...

ADSL - WIFI
NETWORK: Conexant ADSL SOHO Router 4 Port Switch. DHCP=10.0.0.3 to 6, Fixed IP of 10.0.0.2 3Com WiFi 11b & 54g Fixed IP of 10.0.0.1, Currently No DHCP, No WEP, MAC Address selection SET to Users. ESSID not broadcasted. PC(1) Toshiba Satellite Pro - LAN 10/100 = IP Auto, DNS Fixed PROXY set & WiFi 54g PCMCIA (Home Only) Currently IP=10.0.0.5,DNS=10.0.0.2 PC(2) Toshiba Portege - LAN 10/100 = IP Auto, DNS Auto & Built in 11b WiFi = IP Auto, DNS Auto. Both XP Pro PCs belong to professionals set up on different Domains who only want to get wireless internet access not local network. DI...

Configure regional settings and language from access VBA
Hi all i build automation in access that updates the data base one of the problem i bumped is that if the regional setting are on other language beside english it will raise an error indicating on the characters is there an option to stablize the automation to the relevant the language that the windows use ((for example i had problem when the language in the regional language settings was on german ...

Access DAO vs ADO Recordsets
I'm trying to optimize some Access 2002 code, and I've hit a stumbling block. We use Access as our frontend, and SQL Server as our backend. Here's a code fragment from the old implementation of a search for a specific record: ================================= ' Set focus to NdvID and search API_Sleep 200 'MsgBox "DoCmd.FindRecord " & vNdvID & "," & acEntire & "," & False & ", ," & False & ", ," & True Me.txtNdvID.SetFocus DoCmd.FindRecord vNdvID, acEntire, False, , ...

Convert 2000 Calendar to web page
Greetings, When I convert my calendar for 2005 to a webpage, the page is off by 1 day. Is there a template or fix available to fix this? Thanks, Duane I can edit the html file but this should not be the case. Fixes? Suggestions...other than use Apple? "Duane Perry" <dlp_sr@yahoo.com> wrote in message news:yZRtd.5561$0r.1710@newsread1.news.pas.earthlink.net... > Greetings, > > When I convert my calendar for 2005 to a webpage, the page is off by 1 day. > Is there a template or fix available to fix this? > > Thanks, > > Duane > > Duane, ...

XML Note convert to DataSet
Hello, I have this function: object acmResponse = acmLogin.acmString("4001", "", paramFormLogin + paramUserBasics);System.Xml.XmlNode[] acmNodes = (System.Xml.XmlNode[])acmResponse; What I have todo, to convert the XML Object in the DataSet Object? Thank you Matthias ...

Convert
Is it possible to convert a Money file created in the USA version to that of the UK version? Thanks in advance The general way is QIF Export then Import. It's involved and has limitations like loan accounts don't QIF. See http://www.bollar.org/msmoney/#Q1. "Crispy" <nowayspammers@hotmail.com> wrote in message news:uQKSfzfyDHA.2500@TK2MSFTNGP09.phx.gbl... > Is it possible to convert a Money file created in the USA version to that of > the UK version? ...

Outlook Locks up, A program is trying to access your email
We have started getting a popup window saying that a program is trying to access your email. We click no about 5-10 times and then outlook locks up. We have to end task to use it again. Is there a way to find out what program is trying to access my email. Or to find out what the problem is. I look forward to the solutions. I have run scanpst.exe I have update office xp to sp3 I have run spybot, adware I have rud live update (norton) I have a pocket pc but do not sync email on that computer and it happens when it is not connected. Thanks Rafael See http://www.slipstick.com/outlook/...

How to access vrge file
I work at a law firm and need to review a number of vrge files. Are vrge file individual email files or are they the equivalent of a pst file which is a collection of emails, calendar, contacts, etc? We don't use Macs so we need the ability to view on a PC if possible. If that is NOT possible we can borrow a Mac. What is the best way to be able to view these vrge files on any platform? Thanks, Tom On 2/12/10 8:35 AM, in article FF3C8F86-C268-4129-96D3-693FD6F511CB@microsoft.com, "SoxFaninVA" <tjubb@hot.mail.spam.com> wrote: > I work at a law f...

Problem converting from Quicken to M2005
My Quicken files are mostly investment related, and generally converted fine. However all bonds (regular and muni's) converted as Investment type: Mutual Fund, not Bond. (1) How do I prevent that, (2) How do you change the Investment Type for an item? Thank you. In microsoft.public.money, Mike wrote: >My Quicken files are mostly investment related, and generally >converted fine. However all bonds (regular and muni's) converted as >Investment type: Mutual Fund, not Bond. (1) How do I prevent that, (2) Money typically converts custom data types from Quicken into funds. I thou...

Access 2007 bug?
Hi All, is there a known bug for an issue with access 2007, sometimes when I select the After_update event when in visual basic say for a option radio button or a text box, Access stops working and then restarts offering me the option to save a back up of my database, has anyone else had this problem? (vista user) Thanks That can be caused by a number of things, but often portends some corruption in your file. Make sure you do several "Compact & Repair" actions to clear it up. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://ww...

Numbers converting to decimal
I a trying to figure out why when I type 11 and automatically converts it to .11, if I type 11. it will stay 11,if I change all the cells to text then back to number they willstay. I have checked the formatting of the cells, it even happens when I open a brand new worksheet. Any ideas? Thanks Dawn Hi Dawn, Tools>Option>Edit, uncheck Fixed Decimal -- Kind Regards, Niek Otten Microsoft MVP - Excel "DawnP" <anonymous@discussions.microsoft.com> wrote in message news:c3cf01c48a05$d75359d0$a501280a@phx.gbl... > I a trying to figure out why when I type 11 and &...

Is It Possible to Control Access Warning Pop-Up Message Boxes?
When running an update query, Access displays a warning message box and prompts for a response ("You are about to run an update query that will modify data in your table"). I have a macro that runs a series of update queries. Right now, I get the message box/response for each query. In this case, there is no need for the message box at all. Is there a way to (ideally) turn off this message for the duration of the query) or to answer it once for all of the queries? Thanks TerryoMSN It is possible to turn the warning off ... WARNING!!! If you forget to turn it bac...

Converting Quicken 2004 to Money
Quicken 2004 has many bugs, and I have had it. The most recent being that it doesn't work AT ALL now that it is the year 2004. I have had to change the date on my computer today to open it. I want to get Money instead, however I do not know if Money can get my data from the 2004 version. Does anybody know for sure? Yes is the answer to the question you posed. No is the answer to the question you are getting to but didn't pose. M04 imports Q03 and earlier. If the past predicts the future M05 will import Q04. "Colin" <anonymous@discussions.microsoft.com> wrote ...