473,378 Members | 1,152 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,378 software developers and data experts.

Missing operator for MS Access

Hi,

I have getting the error about this. Hope you could help

Expand|Select|Wrap|Line Numbers
  1.  SELECT [NM_DATA clean].UPC_ID, 
  2. DB2SH000_LU_NUTRIENT_FACTOR.UPC_ID, 
  3. DB2SH000_LU_NUTRIENT_FACTOR.NDB_NBR, 
  4. [NM_DATA clean].Source
  5.  
  6. FROM [NM_DATA clean] LEFT JOIN DB2SH000_LU_NUTRIENT_FACTOR 
  7. ON [NM_DATA clean].UPC_ID = DB2SH000_LU_NUTRIENT_FACTOR.UPC_ID
  8.  
  9. where
  10.  
  11. [NM_DATA clean].Source = DB2SH000_LU_NUTRIENT_FACTOR.NDB_NBR
  12.  
  13. if [NM_DATA clean].Source like '9*' and  [NM_DATA clean].Source > 99999999 then [NM_DATA clean].Source= 'NIMS'
  14. else if [NM_DATA clean].Source like '8*' and    [NM_DATA clean].Source > 99999999  then [NM_DATA clean].Source= 'corporate'
  15. else  [NM_DATA clean].Source= 'FNDDS'
  16.  
  17. ENDIF
  18.  
the error is missing operator from here

Expand|Select|Wrap|Line Numbers
  1.  [NM_DATA clean].Source = DB2SH000_LU_NUTRIENT_FACTOR.NDB_NBR
  2.  
  3. if [NM_DATA clean].Source like '9*' and  [NM_DATA clean].Source > 99999999 then [NM_DATA clean].Source= 'NIMS'
  4. else if [NM_DATA clean].Source like '8*' and    [NM_DATA clean].Source > 99999999  then [NM_DATA clean].Source= 'corporate'
  5. else  [NM_DATA clean].Source= 'FNDDS'
  6.  
  7. ENDIF
  8.  
I always made some revision but nothing happens. Hope you can help me on this. thanks
Jul 12 '08 #1
2 1560
missinglinq
3,532 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1.  if [NM_DATA clean].Source like '9*' and  [NM_DATA clean].Source > 99999999 then
I suspect your error is coming from lines like the above. The Like operator takes a string for an argument, but

[NM_DATA clean].Source > 99999999

would seem to indicate that [NM_DATA clean].Source is a numeric datatype.

Depending on whether [NM_DATA clean].Source is text or numerical, you need to convert it to the opposite, using either the str() or val() function.

In the future, please use code tags when posting code, it makes it much easier to read.

Welcome to Bytes!

Linq ;0)>
Jul 12 '08 #2
NeoPa
32,556 Expert Mod 16PB
I'm curious as to what language(s) are being used. There seems to be a mish-mash of SQL & VBA and the explanation doesn't help as it makes so little sense.

@Linq, The line quoted used "Like" against the '9*' which seemed ok - but it also had an "If" in there so who knows whether to check VBA syntax or SQL :S
Jul 16 '08 #3

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

Similar topics

29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
3
by: Mark | last post by:
Hi - I can get this to work in SQL Server - but when also trying to make the application compatible with MS Access I get an error: Select tblfaqnetgroups.group_name from tblfaqnetroles Inner...
4
by: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out...
1
by: Alan Murrell | last post by:
Hello, One of our web hosting clients is getting the following error when someone tried to log in form their login page: --- ODBC ERROR --- Microsoft OLE DB Provider for ODBC Drivers error...
1
by: JMCN | last post by:
I have an ftp program that i inherited and i tried to modify it to ftp over my file however, i receive an error message : run-time error '3075 syntax error (missing operator) in query expression...
2
by: sfrvn | last post by:
I am embarrassed to say I cannot make this work. Recently upgraded to Access 2003, but do not know if that part of problem (AKA 'syntax change'). Would someone be kind enough to lead me by the...
4
Tog
by: Tog | last post by:
Hello, I have read several posts with this heading but none of them have helped. I have the following error message: Syntax error (missing operator) in query expression 'left(Your Product...
3
by: access baby | last post by:
I hava a date parameter filter query but it shows error Syntax error missing operator in query experssion can some one please help where am i going wrong in expression SELECT copyorderdtl * ...
2
by: Lumpy | last post by:
Hi all, I am having a problem with a line of code in access vba. I am trying to use the DLookup function to check whether or not a record already exists with a dealer name. Once I know if it...
4
by: nerd4access | last post by:
Hello all! I am not new to access, but new to coding (and posting). I have a database that I have created and need some help with a login form. When a user opens the database, a form pops up...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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 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.