The select part works fine outside of the insert statement. As I changed the field names here for simplification, its not a problem with the field names being reserved words.
Maybe you could help me with a DCount or Dlookup, i've been looking at these, but not quiet sure how they would work in...
I thought of that also, and changed it, and am back to the original error.
I've thought of breaking this up into two seperate queries, one where i insert area, timeperiod, year, type into the table and then one where i would update the row inserted with the count. but i haven't been able to do...
ok, i added the field list, so now my query looks like this:
INSERT INTO table_stats (Area, TimePeriod, Year, Type, Number)
VALUES ('AREA1','January', 2007,'typeA',
(SELECT Count(ID) FROM table1 WHERE [Area]='AREA1' AND [SalesDate]>=#1/01/2007# AND [SalesDate]<=#1/31/2007# AND [Type]='in'))...
I'm working with a table of sales, and I'm trying to come up with a way of populating a second table that I will use to report the statistics. ie, the number of sales by area and type for a specific month, quarter or year.
I'm trying to build a query that will fill the statistics table, but...
I have a form with a two combo boxes, one for the month and another for the year. Then there are several buttons that when clicked, will run a query based on the month and year selected in the combo boxes and then open the report that corresponds to the button. I'm trying to add a control so...
ok, so i applied all the changes that you suggested, by the way your median function doesn't work if there is only one record returned. and with the dcount function i was able to use the insert into with values(...) so that simplifies this a lot. and things seem to be working fine. thanks a...
interesting... i opened my link to make sure it worked, and ran it, and it went through the median calculations, and i got a type mismatch later on... so maybe the problem isn't in my median function?
anyways let me know what you see.
ok, i created a new mdb, with just the tables and form that calls the code in question.
the form called frmUpdate fills in the table tblVacants with the information from Vacants2007, calculating medians and giving counts for each time period.
i really really appreciate your help!! (and any...
I added Option Explicit.
the recordset is defined as a DAO.Recordset
I ran the compact and repair.
Same thing as before. It seems to stop after the set ssmedian line.
(I did add an error to see what it would do, I added a variable that wasn't defined, just a random thing, and it did at...
I can't get a recordcount on other recordsets if i substitute for example "Select * From Vacants2007" in my openrecordset statement.
Where do you find compact and repair?
Where would the libraries be marked missing? In the references window? If so, it doesn't look like it...
ok, that was actually my error in copying the code here. i forgot to copy in that line with the 'from tablename'.
your median calculation is slightly different but comes to the same thing.
for some reason my access is no longer giving me error messages. the macro just stops. so i've been...
Hi,
I have a function that calculates the median of a selection of values. This function worked fine in November when i ran the report, but in December it didn't run. It seems that i suddenly have a type mismatch error in my Median function when i try to get the number of records selected. I...
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.