I am using it for regression testing of software. By transposing tables (horizontal to vertical), you can easily compare field by field for differences in data.
The datepart function will not understand a date that shows month only. You will need to add a space and a 1 to the string to run the function. Again, assuming the field is called txtdate, use the following:
datepart("m",datevalue([txtdate] & " 1"))
I believe that you will need to put a "rst.movefirst" line in before you start your loop. The recordset is starting out at BOF=true, so you are not on a record yet. Make sure that you test for an empty recordset before moving to any record or it will throw an error if that occurs.
Excel Problem
You can link to an Excel spreadsheet. Once the spreadsheet is linked, you can use it in a query just like a table. The only thing is that the name of the spreadsheet can not change. The link will only work if the full path and name of the spreadsheet are the same. You can...
I looked high and low for this. It can be done by import/export in Excel, but this works very well. (Code is from the Microsoft Knowledge Base).
Function Transposer(strSource As String, strTarget As String)
Dim db As DAO.Database
Dim tdfNewDef As DAO.TableDef
Dim fldNewField As...
The term African-American, while maybe not racist, is certainly prejudiced. There are many Jamaican-Americans that are referred to as African-Americans based on the color of their skin. These people have no ties to Africa whatsoever. It would be like saying all white people with blonde hair...
Here are 2 very common reasons for "not updatable" recordsets.
1. Missing primary keys: Make sure all of your tables have a primary key. Use an autonum if you must, but you are better of using a unique field or concatenated unique fields.
2. Grouping (Totals) queries: If you are using a...
Keep in mind that a using "Format" does not change the underlying data. If the date that you are formatting is a long date, you would get some ugly results if you grouped by it in a query. Both methods will work depending on your needs.
Use the DatePart function. You can return the week number by using the "ww" interval.
DatePart(interval, date[,firstdayofweek[, firstweekofyear]])
The DatePart function syntax has these named arguments:
Part Description
interval Required. String expression that is the interval of time you...
Some of the date functions (DateVal for example) choke when they hit nulls. See if your query is encountering any nulls in the date field. The result of a null is a type mismatch error.
I wouldn't recommend switching back and forth between 'real' and 'sample' data. It could lead to confusion, and corruption of your 'real' data. Why don't you make a copy of the front end, call it 'Sample.mdb', and link it to your 'sample' back end?