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.
I am having a problem with a query I am trying to run in VBA. When I run the query, it will work with Access 97. But when I put the same SQL code into VBA, it will return nothing. I am baffled by this. Here is a piece of the code below. Some of the stuff was censored.
Dim rstWOAM As...
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...
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.