How would I create a new table (tblNew), based on information in an existing
table (tblCurrentData), with today's date appended to the end of the tblNew
name? ( ie: tblNew06032010)
What I am trying to do is, I need a mechanism to store the last four days
worth of data so that comparisons can be made. I can then delete the tables
that are at least 5 days old.
|
|
0
|
|
|
|
Reply
|
Utf
|
6/3/2010 7:56:29 PM |
|
To directly answer your question, you can do it using the CopyObject Method
DoCmd.CopyObject(DestinationDatabase, NewName, SourceObjectType,
SourceObjectName)
However, the fact that you are doing this make me question your data
normalization. You should keep all your data, and the filter... as you need.
You shouldn't need to create copies of tables based on dates. This is bad!
I would reevaluate your table structure a little before continuing any
further. If you need help, post your current setup and I'm sure we can help
you find the proper setup to suit your needs.
--
Hope this helps,
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
"Cathy" wrote:
> How would I create a new table (tblNew), based on information in an existing
> table (tblCurrentData), with today's date appended to the end of the tblNew
> name? ( ie: tblNew06032010)
>
> What I am trying to do is, I need a mechanism to store the last four days
> worth of data so that comparisons can be made. I can then delete the tables
> that are at least 5 days old.
|
|
0
|
|
|
|
Reply
|
Utf
|
6/3/2010 8:05:45 PM
|
|
Daniel,
The table is for accounting forecasting data. The users have a habit of
updating it several times, then change their mind and want to compare back to
something they had a couple of days ago.
I need to create versions so that they can do their job. How else would you
suggest accomplishing this?
I've tried your suggestion, and I can't seem to make " & Now()" work at the
end of the table name. How would you automate adding the date to the table
name using CopyObject?
Thank you so much for your help.
Cathy
"Daniel Pineault" wrote:
> To directly answer your question, you can do it using the CopyObject Method
>
> DoCmd.CopyObject(DestinationDatabase, NewName, SourceObjectType,
> SourceObjectName)
>
> However, the fact that you are doing this make me question your data
> normalization. You should keep all your data, and the filter... as you need.
> You shouldn't need to create copies of tables based on dates. This is bad!
>
> I would reevaluate your table structure a little before continuing any
> further. If you need help, post your current setup and I'm sure we can help
> you find the proper setup to suit your needs.
> --
> Hope this helps,
>
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "Cathy" wrote:
>
> > How would I create a new table (tblNew), based on information in an existing
> > table (tblCurrentData), with today's date appended to the end of the tblNew
> > name? ( ie: tblNew06032010)
> >
> > What I am trying to do is, I need a mechanism to store the last four days
> > worth of data so that comparisons can be made. I can then delete the tables
> > that are at least 5 days old.
|
|
0
|
|
|
|
Reply
|
Utf
|
6/3/2010 8:52:42 PM
|
|
Your code would need to be something like something like
DoCmd.CopyObject , "tblNew" & Format(Date,"mmddyyyy"), acTable,
"tblCurrentData"
--
Hope this helps,
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
"Cathy" wrote:
> Daniel,
>
> The table is for accounting forecasting data. The users have a habit of
> updating it several times, then change their mind and want to compare back to
> something they had a couple of days ago.
>
> I need to create versions so that they can do their job. How else would you
> suggest accomplishing this?
>
> I've tried your suggestion, and I can't seem to make " & Now()" work at the
> end of the table name. How would you automate adding the date to the table
> name using CopyObject?
>
> Thank you so much for your help.
>
> Cathy
>
> "Daniel Pineault" wrote:
>
> > To directly answer your question, you can do it using the CopyObject Method
> >
> > DoCmd.CopyObject(DestinationDatabase, NewName, SourceObjectType,
> > SourceObjectName)
> >
> > However, the fact that you are doing this make me question your data
> > normalization. You should keep all your data, and the filter... as you need.
> > You shouldn't need to create copies of tables based on dates. This is bad!
> >
> > I would reevaluate your table structure a little before continuing any
> > further. If you need help, post your current setup and I'm sure we can help
> > you find the proper setup to suit your needs.
> > --
> > Hope this helps,
> >
> > Daniel Pineault
> > http://www.cardaconsultants.com/
> > For Access Tips and Examples: http://www.devhut.net
> > Please rate this post using the vote buttons if it was helpful.
> >
> >
> >
> > "Cathy" wrote:
> >
> > > How would I create a new table (tblNew), based on information in an existing
> > > table (tblCurrentData), with today's date appended to the end of the tblNew
> > > name? ( ie: tblNew06032010)
> > >
> > > What I am trying to do is, I need a mechanism to store the last four days
> > > worth of data so that comparisons can be made. I can then delete the tables
> > > that are at least 5 days old.
|
|
0
|
|
|
|
Reply
|
Utf
|
6/3/2010 9:51:30 PM
|
|
|
3 Replies
295 Views
(page loaded in 0.091 seconds)
Similiar Articles: Table Default Values - microsoft.public.access.formsIf some other date, you can do something ... the data from a web site and paste-appended the new data into the table. ... Create table: default value for column : Create ... Pivot Chart Format - microsoft.public.access.formsThe data is in a table, appended daily as the example below,Area Date SalesA 1 ... microsoft.public.excel.misc Is it possible to create my own Pivot Table ... I have an append query that I want to run several times ...... are appended. If I click like 10 times my query, all the week endings by job numbers are in my table; so I want to create a ... the table is equal to the job stop date ... AutoNumber Field Not Populating with Append Query - microsoft ...... DISCIPLINE, FROZEN ) SELECT qryDiscipline7.DATE ... this fill in when the new records are appended ... existing table - microsoft.public.access ... > Create a new table ... Pop up Form to set parameter of query to generate a report ...Or is there a way to make a field that is appended ... I have only been able to find ways to create such a field in a table. ... Parameter Pop Up Form with Date Range ... Pivot Table ... Stacked Col & Area Graph - microsoft.public ...Hello, I am trying to create a stacked area Pivot Chart from a Pivot Table. ... The data is in a table, appended daily as the example below,Area Date ... Query Help: Average of Columns Per Row - microsoft.public.access ...I have a table: DATE, Region, HOUR0, HOUR1, ... HOUR23 1 ... with a parameter) but also the daily average appended ... Create a summary query, and sum, first, last, Average ... Concatenate Text Fields to Date Field - microsoft.public.access ...I have three (3) columns in a table which represent ... No records were "appended". However, when I use my ... in one of the rows that makes it impossible to create a date. multi-value field - microsoft.public.accessI have four tables, tblBrochure, tblStaff ... In a fresh column of the Field row, enter the date, e ... MsgBox db.RecordsAffected & " record(s) appended." Append query - current record only (follow on from Ken Stafford su ...> > Per recommendation (appended below after this msg ... Help to create and Insert New Target Date record in Subform Follow Append ... to append a new record to a separate table ... CREATE TABLE - SQL Command - Microsoft Corporation: Software ...CREATE TABLE | DBF TableName1. Creates a table ... D, Date – – Date. T, DateTime – – ... When using table buffering, the table header is locked when the record is appended. How to Create a Date Table or a SQL Server Calendar Table using ...How to Create a Date Table or a SQL Server Calendar Table using CTE T-SQL Code. In this sql article, I'd like to share the t-sql codes for creating dates sql table ... Creating an Append Query in Microsoft Access | Database Solutions ...Records can be appended to a table in the current database ... the data will not be appended. How to create a ... <=DateAdd("yyyy",-2,Date()) This will display ... Oracle: Creating a spool file with date/time appended to file name ...database.itags.org: Oracle question: Creating a spool file with date/time appended to file name ... forum where I learnt that I had to create my table (CREATE TABLE ... APPEND FROM Command - Microsoft Corporation: Software, Smartphones ...CREATE REPORT – Quick Report Command ... Effective conversion of date data from SDF files to Visual FoxPro tables requires ... to specify a code page for the appended table or ... 7/24/2012 8:31:31 AM
|