Hey I figured out the problem. I don't understand why, but the material usage is actually another query I join to. It had criteria that used the "*" for wildcards. So since that did fire the query, then the criteria in the main query wouldn't work. Interesting situation. Thanks everyone for...
Tried the '%' and it didn't work :( I can't understand the issues with the sql.
here is a condensed version of my sql
sql1 = "SELECT WOAM.workorder_number, WOAM.column_value, WOAM.task_number, MOAM.SERVICE_ORGANIZATION, MOAM.REASON_CHANGED, MOAM.SERIAL_NUMBER_REMOVED, MOAM.INVENTORY_ITEM...
what the query has to do is find what are called workorders that are greater than a particular WO (They are Sequential) and only WOs that have the same 4 middle numbers.
OK. The query should only pick up only a handful of rows if any. The test parameters i'm using should create a single row coming back, but it's not. I've done this coding a millions times and i've never had a problem with a query expression where it would work in access and not in VBA
xlbo,
sorry, I didn't place that code after the Set rstWOAM = cnn1.Execute(sql1) code line. I have a while loop that places the recordset values in a spreadsheet. But the while loop fails, because it says there's nothing in the recordset.
Quehay,
took your advice about getting the SQL ouput. Pasted it into access the the sql worked fine. I just don't understand why nothing will come out of the recordset when it's placed into VBA.
...& " WHERE [Armatures - WO after megger].workorder_number>'ABCD-0123-1111' and [Armatures - WO after megger].workorder_number like '" & "ABCD-0123-*" & "'"
sql1 = sql1 & " GROUP BY [Armatures - WO after megger].workorder_number, [Armatures - WO after megger].column_value, [Armatures - WO...
I am trying to convert a text field to a number field. We have a data warehouse, and the table in the warehouse stores number values as text (Why?! no clue!). How can i change the value type on the fly in an Access SQL query? I've tried the CDbl function since the values have 2 decimal place...
I have been looking at my queries, I think I may have some small issues in some of the queries. The final query relies on layers of different queries. I will let you know if I get anywhere with it.
I want to import a query from access into excel, and I keep getting the error "Too few parameters. Expected 1". The thing I don't understand is the query will run flawlessly in access, but for some reason does not work when wanting to import it into Excel. Suggestions?
...find the linked excel table... Is there a specific way a linked table has to be present in the SQL statement?
Here's an example.
Linked Table:
-------------
[Raw Data]
SQL:
----
Select * from [Raw Data];
Then i'll get an error:
-----------------------
runtime error: 80040e37
Please Help!
Well I've done some looking on the computer and ran ad-aware
Came up with 280 objects! that cleared up some of the other problems I was having. I have come to the conclusion it's a virus (since no Anti - virus software was on the computer. But when we checked the harddrive from another computer...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.