PC Review


Reply
Thread Tools Rate Thread

Automatically fetch data from table

 
 
manolakshman
Guest
Posts: n/a
 
      13th Sep 2009
I have 2 tables Emp_Name & Muster. For every single day i need to pick all
the entries in EMp_name. Is there any way to program it, so that I dont need
to copy and paste it every time
 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      13th Sep 2009
If you want to create records in Muster for a specific date, then you might
use an append query.

INSERT INTO Muster (EmpID, MusterDate)
SELECT EmpId, Date() as Today
FROM Emp_Name

Or you can use a query as the source. You need to give a bit more detail as
to the structure of your tables. I am guessing that you have an EmpID field
in both tables and a MusterDate field. You can construct a query based on the
two tables that will show EmpID and a blank field for the musterdate.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

manolakshman wrote:
> I have 2 tables Emp_Name & Muster. For every single day i need to pick all
> the entries in EMp_name. Is there any way to program it, so that I dont need
> to copy and paste it every time

 
Reply With Quote
 
manolakshman
Guest
Posts: n/a
 
      17th Sep 2009
Hey this is in continuation with my earlier post, in a similar way can date
entries in a muster roll can also be done automatically for a particular
month.
For example when I give a month (say:JULY'09) as input can a query select
all the name from the 'Emp_Name' table and fill it in a 'muster roll' table.

"John Spencer" wrote:

> If you want to create records in Muster for a specific date, then you might
> use an append query.
>
> INSERT INTO Muster (EmpID, MusterDate)
> SELECT EmpId, Date() as Today
> FROM Emp_Name
>
> Or you can use a query as the source. You need to give a bit more detail as
> to the structure of your tables. I am guessing that you have an EmpID field
> in both tables and a MusterDate field. You can construct a query based on the
> two tables that will show EmpID and a blank field for the musterdate.
>
> John Spencer
> Access MVP 2002-2005, 2007-2009
> The Hilltop Institute
> University of Maryland Baltimore County
>
> manolakshman wrote:
> > I have 2 tables Emp_Name & Muster. For every single day i need to pick all
> > the entries in EMp_name. Is there any way to program it, so that I dont need
> > to copy and paste it every time

>

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      17th Sep 2009
If you wish to do so, yes. You would need an auxilary table (tblNumbers) with
one field (TheNumber) contains numbers from 1 to at least 31. Then you could
use something like the following. You would enter any date in the month you
were interested in.

INSERT INTO Muster (EmpID, MusterDate)
SELECT EmpId
, DateAdd("d",[tblNumbers].[TheNumber]-1,[Enter Start Date]) as Today
FROM Emp_Name , tblNumbers
WHERE [tblNumbers].[TheNumber] Between 1 and
Day(DateSerial(Year([Enter Start Date]),Month([Enter Start Date])+1,0))

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

John Spencer wrote:
> If you want to create records in Muster for a specific date, then you
> might use an append query.
>
> INSERT INTO Muster (EmpID, MusterDate)
> SELECT EmpId, Date() as Today
> FROM Emp_Name
>
> Or you can use a query as the source. You need to give a bit more
> detail as to the structure of your tables. I am guessing that you have
> an EmpID field in both tables and a MusterDate field. You can construct
> a query based on the two tables that will show EmpID and a blank field
> for the musterdate.
>
> John Spencer
> Access MVP 2002-2005, 2007-2009
> The Hilltop Institute
> University of Maryland Baltimore County
>
> manolakshman wrote:
>> I have 2 tables Emp_Name & Muster. For every single day i need to pick
>> all the entries in EMp_name. Is there any way to program it, so that I
>> dont need to copy and paste it every time

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Won't automatically fetch email John Smith Microsoft Outlook 1 10th Mar 2009 03:54 AM
Won't automatically fetch email John Smith Microsoft Outlook Discussion 1 10th Mar 2009 03:54 AM
How to fetch data from Sql Server table for Comparison and how to do the table binding? ajmera.puneet@gmail.com Microsoft ADO .NET 0 31st Jul 2006 07:31 PM
How to copy 9 fields data from table to other table automatically =?Utf-8?B?QWxhbjQ4?= Microsoft Access VBA Modules 8 21st Jul 2005 02:28 AM
Automatically insert data into a table based on a previous table entry? w1dge Microsoft Access 1 15th Oct 2004 02:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:58 AM.