Copy records, change date, save new...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working with VB.Net 2005 going to an Access 2003 database.

I want to give my user the ability to copy a list of Orders (based on MR #
and PreviousVisitDate) to a new VisitDate when they are creating one. I have
everything ready but I am stuck on how to construct an SQL statement to do
what I need to do. So this is what I have to do..

1. Select all Orders with the specified MR and PreviousVisitDate

2. Copy all of the returned records (to a new temp table??)

3. Change the Date in the returned records to the New Date they entered.

So now I will have the original list and the new list that looks just like
it but with a different Date.

I am sure this is simple for most of you but I am struggling with it. Can
anyone show me an example of how this would be done or point me to one that I
can read through? Thanks for any help you can give me with this.
 
To match columns it would be rather :

INSERT INTO t(a,b,c,d) SELECT a,'Some new value',c,d FROM t WHERE a='xxx'

(changed b,c by c,d at the end of the select statement,'Some new value'
being the replacement for the b coluumn. The literal string delimiter may
also vary as I'm using Access quite rarely, utse the usual string delimited
used by Access...)
 
Back
Top