You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Insert Results of Query Into Table”.
You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Insert Results of Query Into Table”.
Thank you for this helpful article..
Derek –
Thanks for this article. I needed a way to create a duplicate set of records in a table for one of the records management systems we sell and support. In the past, I’d query out the data, then massage it into an INSERT query, run it, then have to go do the same thing again. Now, taking your code and adding some criteria, all I have to do is change an ID (like your WHERE statement) and, waa-laa, I’m done! Much appreciated!
– Jeffrey
Cool, glad it helped!
Oh, forgot to say, I’m using Access 2007.
I’m kind of a newbee at this. I have a table that I enter a techs start time and end time on a service call. I figured out how to use a query and “DataDiff” to calculate the amount of time the tech spent on the job. Now I need that calculated result inserted into the Service Call form after the Start Time and End Time entries.
It should be simple but I can’t seem to get it to work.
Thanks
Ok, let’s see. So you need the DateDiff result to be inserted into the same row. First you would add the column to the table.
ALTER TABLE ServiceCalls ADD CallTimeMins int
UPDATE ServiceCalls
SET CallTimeMins = DATEDIFF(minute,StartTime, EndTime)
This will update the table one time. Use caution however because it will update every row in the entire table.
Does that help?